Hi,
I was looking at the documentation for pagination here: Pagination | Elasticsearch: The Definitive Guide [2.x] | Elastic
which mentions :
Results are sorted before being returned. But remember that a search request usually spans multiple shards. Each shard generates its own sorted results, which then need to be sorted centrally to ensure that the overall order is correct.
Question:
-
Assuming there is no ongoing indexing in the cluster, will ES always return the query results in the same order for each request?
-
If yes, then we can guarantee that if we paginate, we will not see any duplicate/missing records in the paginated results.
-
Also, for a search query, after collecting each shards own sorted results, does ES sort the results again before returning to the client?
-
What is the field used to sort by shards and ES?
Thanks