# Filter query always returns empty

**URL:** <https://discuss.elastic.co/t/filter-query-always-returns-empty/40570>\
**Category:** Elasticsearch\
**Created:** [January 31, 2016, 12:50am UTC](https://discuss.elastic.co/t/filter-query-always-returns-empty/40570 "2016-01-31T00:50:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harish\_Ramanathan](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@Harish\_Ramanathan](https://discuss.elastic.co/u/Harish_Ramanathan)\
**Post date:** [January 31, 2016, 12:50am UTC](https://discuss.elastic.co/t/filter-query-always-returns-empty/40570/1 "2016-01-31T00:50:57Z")

</div>

I am running the query as below in Elasticsearch. Even though there are multiple documents with the filter criteria matching available, I get an empty response. Any help is appreciated

{  
"bool" : {  
"filter" : [ {  
"range" : {  
"CREATE\_TIME" : {  
"from" : "2013-01-01T00:00:00.000Z",  
"to" : "2015-12-31T00:00:00.000Z",  
"include\_lower" : true,  
"include\_upper" : true  
}  
}  
}, {  
"range" : {  
"MODIFY\_TIME" : {  
"from" : "2013-01-01T00:00:00.000Z",  
"to" : "2015-12-31T00:00:00.000Z",  
"include\_lower" : true,  
"include\_upper" : true  
}  
}  
} ],  
"should" : [ {  
"match" : {  
"NAME" : {  
"query" : "Cat",  
"type" : "phrase",  
"boost" : 6.0  
}  
}  
}, {  
"match" : {  
"COL\_NAME" : {  
"query" : "Cat",  
"type" : "phrase",  
"boost" : 5.0  
}  
}  
}, {  
"match" : {  
"SAMPLE\_NAME" : {  
"query" : "Cat",  
"type" : "phrase",  
"boost" : 3.0  
}  
}  
}, {  
"match" : {  
"DESCRIPTION" : {  
"query" : "Cat",  
"type" : "phrase",  
"boost" : 2.0  
}  
}  
}, {  
"match" : {  
"SAMPLE\_DESCRIPTION" : {  
"query" : "Cat",  
"type" : "phrase",  
"boost" : 1.0  
}  
}  
}, {  
"match" : {  
"EXAMPLE" : {  
"query" : "Cat",  
"type" : "phrase",  
"boost" : 6.0  
}  
}  
} ],  
"minimum\_should\_match" : "1"  
}  
}

The Format of Timestamp is same in the index.

---

<div class="post-metadata">

**Author:** ![Geunmoon\_Oh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geunmoon_oh/32/7507_2.png) [@Geunmoon\_Oh](https://discuss.elastic.co/u/Geunmoon_Oh)\
**Post date:** [February 1, 2016, 6:17am UTC](https://discuss.elastic.co/t/filter-query-always-returns-empty/40570/2 "2016-02-01T06:17:51Z")

</div>

how about using keyword 'cat' instead of 'Cat'?  
Analyzed keyword is commonly lower character.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 1, 2016, 6:34am UTC](https://discuss.elastic.co/t/filter-query-always-returns-empty/40570/3 "2016-02-01T06:34:52Z")

</div>

Might depends on your mapping.  
Can you provide it and a matching document?

Within a script would be even better.

---

<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:19pm UTC](https://discuss.elastic.co/t/filter-query-always-returns-empty/40570/4 "2017-07-05T23:19:59Z")

</div>


