简体   繁体   中英

Elasticsearch scroll not working

I am running the following elasticsearch aggregation query

curl -XPOST 'http://localhost:9200/ae2015/_search/?scroll=1m' -d '{
            "size" : 0,
            "query":{"constant_score":{"filter": {"geo_bounding_box" : {"location": {"top_left" : [-180, 85],"bottom_right" : [180, -85]}}}}},
            "aggs":{
                "grid": {
                    "geohash_grid": {"field":"location","precision": 3},
                    "aggs": {
                        "count":{"sum":{"field":"count"}}
                    }
                }
            }
        }'

This returns a scroll_id as expected, but when I use it, the response is "empty", ie

{"_scroll_id":"xxx","took":936,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":13238893,"max_score":0.0,"hits":[]}}

It's as if scrolling doesn't work with aggregations.

Any suggestion would be very much appreciated.

From the official documentation on scrolling :

If the request specifies aggregations, only the initial search response will contain the aggregations results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM