# Using filters in a range query not braking the results, but not filtering them either

**URL:** <https://discuss.elastic.co/t/using-filters-in-a-range-query-not-braking-the-results-but-not-filtering-them-either/14228>\
**Category:** Elasticsearch\
**Created:** [November 2, 2013, 6:13pm UTC](https://discuss.elastic.co/t/using-filters-in-a-range-query-not-braking-the-results-but-not-filtering-them-either/14228 "2013-11-02T18:13:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arozar](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@arozar](https://discuss.elastic.co/u/arozar)\
**Post date:** [November 2, 2013, 6:13pm UTC](https://discuss.elastic.co/t/using-filters-in-a-range-query-not-braking-the-results-but-not-filtering-them-either/14228/1 "2013-11-02T18:13:56Z")

</div>

I'm trying to to filter results from this range query.

curl -X GET 'logmon:9200/\_search?pretty=true' -d '  
{  
"size" :100000 ,  
"fields" : ["@message"],  
"query" : {  
"range" : {  
"@timestamp" : {  
"from" : "2013-10-16T00:00:00.0000",  
"to" : "2013-10-31T00:00:00.0000"  
}  
}  
}  
},  
"filter" : {  
"term" : {  
"@message" : "drop"  
}  
}'

This yields no different results than the query below, but I know there are  
three @messages with the term "drop" in it within this time frame.

curl -X GET 'logmon:9200/\_search?pretty=true' -d '  
{  
"size" :100000 ,  
"fields" : ["@message"],  
"query" : {  
"range" : {  
"@timestamp" : {  
"from" : "2013-10-16T00:00:00.0000",  
"to" : "2013-10-31T00:00:00.0000"  
}  
}  
}  
}'

Am I using the filter incorrectly?

When I use this search, I get the three @messages. Essentially I'm trying  
to add the time range to this search.

curl -X GET 'logmon:9200/\_search?pretty=true' -d '  
{  
"size" :100000 ,  
"fields" : ["@message"],  
"query" : {  
"term" : {  
"@message" : "drop"  
}  
}  
}'

Thank you.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:09am UTC](https://discuss.elastic.co/t/using-filters-in-a-range-query-not-braking-the-results-but-not-filtering-them-either/14228/2 "2017-07-06T02:09:13Z")

</div>

Closed on July 6, 2017, 2:09am UTC


