# Help 1.x to 5.x search\_type=count and size=0

**URL:** <https://discuss.elastic.co/t/help-1-x-to-5-x-search-type-count-and-size-0/82234>\
**Category:** Elasticsearch\
**Created:** [April 13, 2017, 12:31am UTC](https://discuss.elastic.co/t/help-1-x-to-5-x-search-type-count-and-size-0/82234 "2017-04-13T00:31:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl\_Putland](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karl_putland/32/719_2.png) [@Karl\_Putland](https://discuss.elastic.co/u/Karl_Putland)\
**Post date:** [April 13, 2017, 12:31am UTC](https://discuss.elastic.co/t/help-1-x-to-5-x-search-type-count-and-size-0/82234/1 "2017-04-13T00:31:24Z")

</div>

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](http://eshost:9200) "GET /myindex/\_search?ignore\_unavailable=true&size=0 HTTP/1.1" 200 **1548845902**

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [April 18, 2017, 8:26am UTC](https://discuss.elastic.co/t/help-1-x-to-5-x-search-type-count-and-size-0/82234/2 "2017-04-18T08:26:24Z")

</div>

`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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 16, 2017, 8:30am UTC](https://discuss.elastic.co/t/help-1-x-to-5-x-search-type-count-and-size-0/82234/3 "2017-05-16T08:30:50Z")

</div>

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