Reputation: 123
I am using elastic search in my project, for searching we have genreally 2 methods:-
What is the difference between the two methods? And, which one is more efficient?
Thanks in advance
Upvotes: 0
Views: 404
Reputation: 7649
setQuery()
method. You can also pass filter
as per your requirement.It is like findByid()
. You have to specify the id of the document to be fetched.
Executed for one type under one index.
The Get operation gets hashed into a specific shard id. It then gets redirected to one of the replicas within that shard id and returns the result.
PrepareGet
is more efficient as it fetches the data on the basis of id.
Upvotes: 1