Elasticquent
Elasticquent copied to clipboard
delete/update item from index?
Hello,
docs do not mention(?) what needs to be done when deleting/updating the Entity.
Is there something we should do manually when Entity was updated, or removed?
Thank you
You could bind to a model events such as updated, deleted etc...
Then iterate through the relations:
$post->comments->each(function ($comment) {
$comment->removeFromIndex();
});
$post->editors->each(function ($editor) {
$editor->removeFromIndex();
});
I would do this asynchronously through a queue.
@huglester you might be interested in this:
https://github.com/elasticquent/Elasticquent/pull/136/commits/cc2e18c3a0c5af8f83fbcddd45ff7476eb704f0b
Thank you. @timgws - but this commit was not merged - right?
Correct. The pull request includes a change to the composer.json file, so I will need to cherry pick the commit and merge it manually.