1

Is there any way to do pagination using Elastic search with aggregation? the elasticsearch version is 2.3. This is the query:

{
  "query": {
    "match": {
      "clientMac": "88:"
    }
  },
  "aggs": {
    "top_tags": {
      "terms": {
        "field": "clientMac.rawData"
      },
      "aggs": {
        "top_client_hits": {
          "top_hits": {
            "sort": [
              {
                "event_timestamp": {
                  "order": "desc"
                }
              }
            ],
            "_source": {
              "includes": [
                "event_timestamp"
              ]
            },
            "size": 1
          }
        }
      }
    }
  }
}
Eli
  • 4,576
  • 1
  • 27
  • 39
Daoud Shaheen
  • 364
  • 4
  • 16
  • Paginating aggregation results is not available in ES - [Paging support for aggregations](https://github.com/elastic/elasticsearch/issues/4915) – Eli Jan 09 '18 at 08:17
  • Possible duplicate of [Aggregation + sorting +pagination in elastic search](https://stackoverflow.com/questions/27776582/aggregation-sorting-pagination-in-elastic-search) – Özgür Yalçın Mar 10 '19 at 02:16

1 Answers1

1

From elastic 5 you do have the ability by partitioning the buckets of terms aggregation. You can read about it here: https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-aggregations-bucket-terms-aggregation.html#_filtering_values_with_partitions

Itai
  • 13
  • 4