elasticsearch
elasticsearch copied to clipboard
Can we pass the id instead of letting ES to create a id
In elasticsearch we can pass the id (ex: if the model is already in mysql we have a id and want to use same id in ES as well)
In your documentation I saw examples where you retrieve by id
$post = App\Post::find(1);
which means we should be able to create by giving id=1 as well.
How to do this?
When I check the code it seems to me that you're assuming passing _id
field means it's a update? Correct me if I'm wrong
Thank you