More Examples of 'search_after'?

Please excuse me for being obtuse, but the explanation of how the 'search_after' query works is completely confusing to me

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-after.html

I don't really understand what these numbers are and how do they relate to other examples of queries one might use?
"search_after": [1463538857, "654323"],

Any help or examples in a different context will be much appreciated! Aloha :hibiscus::call_me_hand:

Google answered my question, and indeed I was missing something obvious. For others who are wondering here is a very clear example (something like this could make the ES docs a little more clear):

  • If there are 31 annotations—1 for each day in October—the search parameter combination of sort =updated, order =desc, limit =10, and search_after =2018-10-05 will retrieve annotations made from the 6th of October to the 16th of October.
  • If there are 31 annotations with IDs 0-31, the search parameter combination of sort =id, order =asc, limit =10, and search_after =5, will return the annotations with IDs 6-16.

Searching using offset and limit is inefficient because elasticsearch must load all the annotations ( offset + limit number of annotations) into memory and sort them before returning the window of annotations defined by offset and limit . search_after does not require all the annotations to be loaded and sorted because it can be applied as a filter on the search query itself—as opposed to offset , which must be applied after the initial search. This is why search_after is more efficient and, while the old parameter offset does remain, it is not recommended to use it.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.