April 21, 2025
OpenSearch & Elasticsearch Scroll and Deep Paging Methods Compared

OpenSearch & Elasticsearch Scroll and Deep Paging Methods Compared

In some cases a deep paginated search on an Elasticsearch or OpenSearch cluster is required. In this power tip we compare the various available options.

Deep Paging in Elasticsearch and OpenSearch refers to retrieving a large number of search results beyond the default page of 10 and often also beyond the default limit of 10,000 documents. Since Elasticsearch is designed for speed and efficiency, fetching deep results can be resource-intensive and impact cluster performance. For when this is needed still, Elasticsearch provides several mechanisms to handle deep paging efficiently.

While Elasticsearch was designed to respond quickly to aggregation queries or top few documents, some scenarios are valid for retrieving thousands or more of documents, such as:

  • Analytics and Reporting: Generating reports that require processing large (potentially filtered) datasets.
  • Full Data Export: Extracting large sets of data for external storage or processing.
  • Data Synchronization: Syncing search indices with external databases.
  • Pagination for Large Applications: Serving large-scale applications with extensive pagination needs.

Following are the various options of performing deep-paging operations, with

Using from and size