# Count request does not support \[filter\]. Why?

**URL:** <https://discuss.elastic.co/t/count-request-does-not-support-filter-why/18210>\
**Category:** Elasticsearch\
**Created:** [June 19, 2014, 1:23pm UTC](https://discuss.elastic.co/t/count-request-does-not-support-filter-why/18210 "2014-06-19T13:23:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Gaydenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_gaydenko/32/914_2.png) [@Andrew\_Gaydenko](https://discuss.elastic.co/u/Andrew_Gaydenko)\
**Post date:** [June 19, 2014, 1:23pm UTC](https://discuss.elastic.co/t/count-request-does-not-support-filter-why/18210/1 "2014-06-19T13:23:39Z")

</div>

Count request does not support [filter]. Why? How to count with the same  
filter (except for "size", "fields", "from") and query I'm probably going  
to search hits after counting?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/290e2be1-6f48-4266-a02e-4c8ff7620225%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/290e2be1-6f48-4266-a02e-4c8ff7620225%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 20, 2014, 7:35am UTC](https://discuss.elastic.co/t/count-request-does-not-support-filter-why/18210/2 "2014-06-20T07:35:33Z")

</div>

Hey,

not a hundred percent sure, what you mean here. The post\_filter setting?  
There are two possibilities: Either use the search\_type=count or use a  
filtered query in the count API. See

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Also, be aware that the execution models are a bit different (which may  
result in different performance), see

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Hope this helps, if not please refine your questions

--Alex

On Thu, Jun 19, 2014 at 3:23 PM, Andrew Gaydenko [andrew.gaydenko@gmail.com](mailto:andrew.gaydenko@gmail.com)  
wrote:

> Count request does not support [filter]. Why? How to count with the same  
> filter (except for "size", "fields", "from") and query I'm probably going  
> to search hits after counting?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/290e2be1-6f48-4266-a02e-4c8ff7620225%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/290e2be1-6f48-4266-a02e-4c8ff7620225%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/290e2be1-6f48-4266-a02e-4c8ff7620225%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/290e2be1-6f48-4266-a02e-4c8ff7620225%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM9oHqQVvAbnh4pTRvtv%3DhzZJmq6YWnRjnkcRSXNqiVbcQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM9oHqQVvAbnh4pTRvtv%3DhzZJmq6YWnRjnkcRSXNqiVbcQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Andrew\_Gaydenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_gaydenko/32/914_2.png) [@Andrew\_Gaydenko](https://discuss.elastic.co/u/Andrew_Gaydenko)\
**Post date:** [June 20, 2014, 8:38am UTC](https://discuss.elastic.co/t/count-request-does-not-support-filter-why/18210/3 "2014-06-20T08:38:46Z")

</div>

Sorry, I wasn't clear enough. I mean Java client's CountRequest.source()'s  
argument content, "{ filter: ... }" in particular.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b402f868-eeaf-484a-9081-75e81b7f5aed%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b402f868-eeaf-484a-9081-75e81b7f5aed%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:20am UTC](https://discuss.elastic.co/t/count-request-does-not-support-filter-why/18210/4 "2017-07-06T01:20:58Z")

</div>


