# Deprecation of filtered in elasticsearch 2.0

**URL:** <https://discuss.elastic.co/t/deprecation-of-filtered-in-elasticsearch-2-0/32917>\
**Category:** Elasticsearch\
**Created:** [October 24, 2015, 5:53pm UTC](https://discuss.elastic.co/t/deprecation-of-filtered-in-elasticsearch-2-0/32917 "2015-10-24T17:53:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anirudh\_Modi](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@Anirudh\_Modi](https://discuss.elastic.co/u/Anirudh_Modi)\
**Post date:** [October 24, 2015, 5:53pm UTC](https://discuss.elastic.co/t/deprecation-of-filtered-in-elasticsearch-2-0/32917/1 "2015-10-24T17:53:46Z")

</div>

With elasticsearch 2.0 filtered will be deprecated. Instead of which we need to use bool..  
In filtered it was mentioned that filtered query will run the filter before the query.. How will this work with bool?

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 24, 2015, 6:22pm UTC](https://discuss.elastic.co/t/deprecation-of-filtered-in-elasticsearch-2-0/32917/2 "2015-10-24T18:22:50Z")

</div>

Maybe you have missed this blog post? [https://www.elastic.co/blog/better-query-execution-coming-elasticsearch-2-0](https://www.elastic.co/blog/better-query-execution-coming-elasticsearch-2-0)

---

<div class="post-metadata">

**Author:** ![Anirudh\_Modi](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@Anirudh\_Modi](https://discuss.elastic.co/u/Anirudh_Modi)\
**Post date:** [October 24, 2015, 7:14pm UTC](https://discuss.elastic.co/t/deprecation-of-filtered-in-elasticsearch-2-0/32917/3 "2015-10-24T19:14:43Z")

</div>

Yes i did missed it out.. Never ran into this blog.. Thanks

---

<div class="post-metadata">

**Author:** ![mramaprasad](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@mramaprasad](https://discuss.elastic.co/u/mramaprasad)\
**Post date:** [January 5, 2016, 11:44pm UTC](https://discuss.elastic.co/t/deprecation-of-filtered-in-elasticsearch-2-0/32917/4 "2016-01-05T23:44:59Z")

</div>

I have the following query which has bool query and a filter.  
curl -XGET '[http://localhost:9200/cstest/teset1/\_search?pretty=true](http://localhost:9200/cstest/teset1/_search?pretty=true)' -d '  
{  
"from" : 0,  
"size" : 10,  
"query" : {  
"bool" : {  
"must" : {  
"multi\_match" : {  
"query" : "java",  
"fields" : ["title", "description"]  
}  
},  
“filter”:[  
{ "range": { "pubdate": { "gte": "2014-01-01" }}}  
]

```
}

```

}  
}’

This gives me the following error.  
reason" : "bool query does not support [“filter”]",  
Any ideas wjhat I am doing wrong?

---

<div class="post-metadata">

**Author:** ![shanec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shanec/32/4004_2.png) [@shanec](https://discuss.elastic.co/u/shanec)\
**Post date:** [January 6, 2016, 1:15am UTC](https://discuss.elastic.co/t/deprecation-of-filtered-in-elasticsearch-2-0/32917/5 "2016-01-06T01:15:24Z")

</div>

Eeks! @mramaprasad you have the wrong quote double-quote character there.

You have “filter” and it should be "filter". The blog post uses the wrong double-quote characters as well, so it's no good if you copied/pasted from that. Sorry for that!

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [January 6, 2016, 9:00am UTC](https://discuss.elastic.co/t/deprecation-of-filtered-in-elasticsearch-2-0/32917/6 "2016-01-06T09:00:15Z")

</div>

@mramaprasad please do not ask the same question in many threads. You have also asked this in [Elasticsearch 2 - filtered query](https://discuss.elastic.co/t/elasticsearch-2-filtered-query/38449) and [Filtered query in Elasticsearch 2](https://discuss.elastic.co/t/filtered-query-in-elasticsearch-2/38430) all within a few hours. Be patient when waiting for an answer to your questions, this is a community forum and therefore you may not get an immediate response to your questions (see [https://www.elastic.co/community/codeofconduct](https://www.elastic.co/community/codeofconduct) for more details)

---

<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 5, 2017, 11:26pm UTC](https://discuss.elastic.co/t/deprecation-of-filtered-in-elasticsearch-2-0/32917/7 "2017-07-05T23:26:48Z")

</div>


