You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently specifying a starting offset when doing a search_after search is rejected as illegal operation.
For use cases where people wish to provide their users with comfortable pagination, something like (when on page 51 out of 123): [1] [2] [3] ... [49] [50] *51* [52] [53] ... [121] [122] [123]
Currently jumping to page 49 or 53 is impossible without either retrieving too many results or specifying large value for "from". If we allowed "from" with "search_after" users could implement efficient searches to retrieve any page displayed:
[1], [2], [3] by using simple pagination (setting "from" to 0, 10, and 20 respectively)
[121], [122], [123] by reversing the sort orders for all fields, using simple pagination and then reversing the returned hits in app
[52], [53] by setting "search_after" to the sort value of the last hit on page 51 and using simple pagination
[49], [50] by reversing sort, setting "search_after" to the sort value of the first hit on page 51, using simple pagination and then reversing the returned hits in app
That way any page can be calculated cheaply and no deep pagination will be required. The largest size of hits to be sorted would be (N+1)*PAGE_SIZE where N is the number of page links displayed to either side of current page.
The text was updated successfully, but these errors were encountered:
We discussed this with @honzakral and decided that we won't allow it in Elasticsearch. The solution is to do this pagination on the client side by requesting more documents than needed. This shouldn't be an issue because you can also limit the pages that are directly reachable from a specific position.
Currently specifying a starting offset when doing a
search_after
search is rejected as illegal operation.For use cases where people wish to provide their users with comfortable pagination, something like (when on page 51 out of 123):
[1] [2] [3] ... [49] [50] *51* [52] [53] ... [121] [122] [123]
Currently jumping to page
49
or53
is impossible without either retrieving too many results or specifying large value for"from"
. If we allowed"from"
with"search_after"
users could implement efficient searches to retrieve any page displayed:[1]
,[2]
,[3]
by using simple pagination (setting"from"
to0
,10
, and20
respectively)[121]
,[122]
,[123]
by reversing the sort orders for all fields, using simple pagination and then reversing the returned hits in app[52]
,[53]
by setting"search_after"
to thesort
value of the last hit on page 51 and using simple pagination[49]
,[50]
by reversing sort, setting"search_after"
to thesort
value of the first hit on page 51, using simple pagination and then reversing the returned hits in appThat way any page can be calculated cheaply and no deep pagination will be required. The largest size of hits to be sorted would be (N+1)*PAGE_SIZE where N is the number of page links displayed to either side of current page.
The text was updated successfully, but these errors were encountered: