We have seen that for any query, Elasticsearch by default returns only the top 10 documents after scoring and sorting them. However, they are not always enough to serve the purpose. A user always needs more and more data either to render on a page or to process in the backend. Let's see how we can do this.
In the previous chapters, we discussed how Elasticsearch offers the
to parameters to be passed with search requests. So, you always have an option to either increase the
size parameter to load more results from Elasticsearch or send another query with the changed
size values to get more data.
This pagination approach makes sense when you have to fetch a limited number of documents from Elasticsearch. ...