Elasticsearch returns different results from the same paginated query

So I was playing around with pagination and trying to solve a problem where the result on page 64 will sometimes contain a hit on page 65.

If I execute this request

http://host:9200/index/_search?q=field:searchterm&size=1&from=100

      

I found that every second query result is identical.

But if the pagination parameter has a lower value, all the results are identical.

I've played around with sorting, but the behavior is consistent.

+3


source to share


1 answer


Try adding the preference parameter to the request parameter. I am guessing it might be due to the bouncing result .

For load balancing, you can probably use a preference parameter with a custom string such as the username for the initial request.



Use the same custom string for subsequent paging requests

+5


source







All Articles