Hi,
I was evaluating the performance of various pagination options. The ones that were considered were:
- Scroll API
- Search After API
- from,size fields
I carried out the test for a set of 1000 documents. And analyzed the profiling for each type of API for two queries.
query-a: Retrievel of first 500 documents.
query-b: Retrival of last 500 documents.
sorted by timestamp.
Observations.
Total number of hits for both queries (query-a and query-b), was 1000 for all types of APIs.
Questions:
- What is the difference in the implementation of these APIs if the number of hits is always same?
- How does each of API work? Do all APIs retreive all documents for each query. If so, what is the exact use of context in scroll API and search_after API?
3, Which API is better in terms of performance and Why?
PS: Documentation doesn't provide any clue about how these APIs are implemented internally.