I read this doc to understand 'search_after' and have two question.
When I added multiple parameter of search_after, Is that 'and' condition or 'or' condition?
ex) "search_after": [1463538857, 5147821]
By default, you cannot use from and size to page through more than 10,000 hits. This limit is a safeguard set by the index. max_result_window index setting. If you need to page through more than 10,000 hits, use the search_after parameter instead.
The Simplest to Implement The simplest method of pagination uses the from and size parameters available in Elasticsearch's search API. By default, from is 0 and size is 10, meaning if you don't specify otherwise, Elasticsearch will return only the first ten results from your index.
Deep pagination is one of the top performance killers for your cluster. Deep pagination means to allow the user access to too many pages. You should never give your users access to all the pages of their search request.
As mentioned in that doc, "tweet#654323"
is the _uid
value of the document, which is made up of the _type
and the _id
of the document.
You need as many values in search_after
as you have sort
clauses and those values must be ordered the same way as in your sort clause. In "search_after": [1463538857, 5147821]
, it looks like you're sorting by a date field and some other id field.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With