# Fuzzy numeric search on several fields

**URL:** <https://discuss.elastic.co/t/fuzzy-numeric-search-on-several-fields/12215>\
**Category:** Elasticsearch\
**Created:** [June 1, 2013, 4:18am UTC](https://discuss.elastic.co/t/fuzzy-numeric-search-on-several-fields/12215 "2013-06-01T04:18:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene\_Strokin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eugene_strokin/32/1238_2.png) [@Eugene\_Strokin](https://discuss.elastic.co/u/Eugene_Strokin)\
**Post date:** [June 1, 2013, 4:18am UTC](https://discuss.elastic.co/t/fuzzy-numeric-search-on-several-fields/12215/1 "2013-06-01T04:18:05Z")

</div>

Hello, I need help writing a query for fuzzy numeric search. my documents have 4 numeric fields. I have 4 numbers one for each field, and I need to find documents where all 4 fields are the closest to those 4 numbers. So, this is exactly what fuzzy numeric search does, but I don't understand how to combine those 4 fields into one query. Could someone help me out?  
Any help is appreciated.  
thanks in advance  
Eugene

--  
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:** ![Eugene\_Strokin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eugene_strokin/32/1238_2.png) [@Eugene\_Strokin](https://discuss.elastic.co/u/Eugene_Strokin)\
**Post date:** [June 3, 2013, 2:19pm UTC](https://discuss.elastic.co/t/fuzzy-numeric-search-on-several-fields/12215/2 "2013-06-03T14:19:14Z")

</div>

Hello again,  
I was trying to find the answer on my own, and the only solution I could  
find is boolean query using "must":

QueryBuilders.boolQuery()

.must(QueryBuilders.fuzzyQuery("numberA", "9.567").minSimilarity(1f))

.must(QueryBuilders.fuzzyQuery("numberB", "15.822").minSimilarity(1f))

etc...

Am I on the right direction, or I should use something else?

Thank you,

Eugene

On Saturday, June 1, 2013 12:18:05 AM UTC-4, Eugene Strokin wrote:

> Hello, I need help writing a query for fuzzy numeric search. my documents  
> have 4 numeric fields. I have 4 numbers one for each field, and I need to  
> find documents where all 4 fields are the closest to those 4 numbers. So,  
> this is exactly what fuzzy numeric search does, but I don't understand how  
> to combine those 4 fields into one query. Could someone help me out?  
> Any help is appreciated.  
> thanks in advance  
> Eugene

--  
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:33am UTC](https://discuss.elastic.co/t/fuzzy-numeric-search-on-several-fields/12215/3 "2017-07-06T02:33:19Z")

</div>

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


