Help 1.x to 5.x search_type=count and size=0

I have a large query that I just need aggregations on.

In 1.7 I used search_type=count and the query runs fine.
in 5.x That option is no longer available, so I try size=0 and the query... adapted from filtered to bool w/ filter context is trying to return 1.5GB of data and stalls.

(
  "query": {
    "bool": {
       "filter": {
         "should": [ ... big giant filter list ...]
      } 
    }
  },
  "aggs": {
    "SOME_AGGS": { ... }
  }
  "size": 0
}

2017-04-12 17:30:19,897 - urllib3.connectionpool - DEBUG - http://eshost:9200 "GET /myindex/_search?ignore_unavailable=true&size=0 HTTP/1.1" 200 1548845902

size: 0 is the right replacement. It's equivalent to count I suspect your issue is inside the filter. Try to run it without the aggs part and see how many docs it returns and how many it should.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.