0

I want paging results using from and size attributes.

but, 'from' attribute in aggregation is not supported expression.

Can I get other approach?

Query Syntax:

{
  "size": 0,
    "query": {
        "bool": {
            "must": [{
                "match_phrase": {
                    "name": "John"
                }
            }]
        }
    },
  "aggs":{
    "dedup" : {
      "terms":{
        "field": "job",
        "from": 2, <<-- Is it possible??
        "size": 1
       },
       "aggs":{
         "dedup_docs":{
           "top_hits":{
             "size":1
           }
         }
       }
    }
  }
}

This is error message:

"type": "search_parse_exception"

"reason": "Unknown key for a VALUE_NUMBER in [dedup]: [from].",

Go Namhyeon
  • 631
  • 1
  • 5
  • 15
  • This answer should help: http://stackoverflow.com/questions/35945769/elastic-search-aggregation-pagination-issue – Val Oct 19 '16 at 06:04
  • Possible duplicate of [How to control the elasticsearch aggregation results with From / Size?](https://stackoverflow.com/questions/43038131/how-to-control-the-elasticsearch-aggregation-results-with-from-size) – John Jones Aug 09 '17 at 00:46

1 Answers1

0

Aggregation can not use 'page' attribution. please check 'scroll' api.

Go Namhyeon
  • 631
  • 1
  • 5
  • 15