# Equality on numeric field in a filter

**URL:** <https://discuss.elastic.co/t/equality-on-numeric-field-in-a-filter/9963>\
**Category:** Elasticsearch\
**Created:** [December 5, 2012, 11:12pm UTC](https://discuss.elastic.co/t/equality-on-numeric-field-in-a-filter/9963 "2012-12-05T23:12:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Weitzenfeld](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_weitzenfeld/32/2593_2.png) [@Daniel\_Weitzenfeld](https://discuss.elastic.co/u/Daniel_Weitzenfeld)\
**Post date:** [December 5, 2012, 11:12pm UTC](https://discuss.elastic.co/t/equality-on-numeric-field-in-a-filter/9963/1 "2012-12-05T23:12:57Z")

</div>

I'm trying to figure out the best way to check for equality on a numeric  
field in a filter. (I'm using a custom\_filters\_score query, and I want to  
boost documents by a specific amount if they have a certain value in a  
certain numeric field)  
There's a 'match' query, but no 'match' filter, at least according to the  
docs.  
Do I have to use numeric\_range, and just set the 'from' and the 'to'  
accordingly?  
Thanks,  
Dan

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [December 7, 2012, 4:17am UTC](https://discuss.elastic.co/t/equality-on-numeric-field-in-a-filter/9963/2 "2012-12-07T04:17:32Z")

</div>

You can use term filter and numeric\_range filter.

On Wednesday, December 5, 2012 6:12:57 PM UTC-5, Daniel Weitzenfeld wrote:

> I'm trying to figure out the best way to check for equality on a numeric  
> field in a filter. (I'm using a custom\_filters\_score query, and I want to  
> boost documents by a specific amount if they have a certain value in a  
> certain numeric field)  
> There's a 'match' query, but no 'match' filter, at least according to the  
> docs.  
> Do I have to use numeric\_range, and just set the 'from' and the 'to'  
> accordingly?  
> Thanks,  
> Dan

--

---

<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, 3:00am UTC](https://discuss.elastic.co/t/equality-on-numeric-field-in-a-filter/9963/3 "2017-07-06T03:00:57Z")

</div>


