# No results in fuzzy query\_string query with 0.01 fuzzy\_min\_sim value

**URL:** <https://discuss.elastic.co/t/no-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value/13189>\
**Category:** Elasticsearch\
**Created:** [August 13, 2013, 1:03am UTC](https://discuss.elastic.co/t/no-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value/13189 "2013-08-13T01:03:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdyck](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jdyck](https://discuss.elastic.co/u/jdyck)\
**Post date:** [August 13, 2013, 1:03am UTC](https://discuss.elastic.co/t/no-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value/13189/1 "2013-08-13T01:03:21Z")

</div>

I'm trying to get fuzzy search working using the query\_string query but I'm having a lot of issues. It seems like no matter what I set my fuzzy\_min\_sim value to, it makes very little difference in the results.

Here is a small example of my situation:

> <https://gist.github.com/SeventhHelix/911789353a91de6810f4>

Why is it that the above won't return the correct result, even with a 0.01 fuzzy\_min\_sim value? As far as I understand, it isn't a term/token problem because I'm setting the mapping to be lowercase and as a single token. I've also tested this with just a simple string as the email field like abcdefghijklmnopqrstuvwxyz and had similar results.

How can I set this up so that even if I misspell half the entire field I still get the right result? I thought that's what the fuzzy\_min\_sim value was, at 0.5 it will return matches where the L distance is under 0.5\*len(string), i.e. 15 incorrect characters in this case.

Thank-you!

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [August 13, 2013, 10:42am UTC](https://discuss.elastic.co/t/no-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value/13189/2 "2013-08-13T10:42:08Z")

</div>

Actually the float notion of the min\_similarity is not fully supported  
anymore. We only support string distance 1 or 2 (Levenshtein Distance) so  
no matter what you put in the float it will be Math.min(2,  
floatToLD(value)) of some sort. your example has way more than 2 edits.

simon

On Tuesday, August 13, 2013 3:03:21 AM UTC+2, Jeff Dyck wrote:

> I'm trying to get fuzzy search working using the query\_string query but  
> I'm  
> having a lot of issues. It seems like no matter what I set my  
> fuzzy\_min\_sim  
> value to, it makes very little difference in the results.
> 
> Here is a small example of my situation:  
> [gist:911789353a91de6810f4 · GitHub](https://gist.github.com/SeventhHelix/911789353a91de6810f4)
> 
> Why is it that the above won't return the correct result, even with a 0.01  
> fuzzy\_min\_sim value? As far as I understand, it isn't a term/token problem  
> because I'm setting the mapping to be lowercase and as a single token.  
> I've  
> also tested this with just a simple string as the email field like  
> abcdefghijklmnopqrstuvwxyz and had similar results.
> 
> How can I set this up so that even if I misspell half the entire field I  
> still get the right result? I thought that's what the fuzzy\_min\_sim value  
> was, at 0.5 it will return matches where the L distance is under  
> 0.5\*len(string), i.e. 15 incorrect characters in this case.
> 
> Thank-you!
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/No-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value-tp4039516.html](http://elasticsearch-users.115913.n3.nabble.com/No-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value-tp4039516.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
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:** ![jdyck](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jdyck](https://discuss.elastic.co/u/jdyck)\
**Post date:** [August 13, 2013, 3:31pm UTC](https://discuss.elastic.co/t/no-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value/13189/3 "2013-08-13T15:31:20Z")

</div>

Hmm, interesting, thanks Simon. If this is the case, is there another recommended way of doing fuzzy matching with greater possible distance?

I find this a bit odd, though. I seem to remember doing fuzzy matching with this same type of query not too long ago and still had good results, and I've not updated my version of ES in a while.

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [August 13, 2013, 4:02pm UTC](https://discuss.elastic.co/t/no-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value/13189/4 "2013-08-13T16:02:31Z")

</div>

This is the old fuzzy query that has super bad performance. The new fuzzy  
query is blazing fast but has the limits to 2 edits. You can potentially  
write a query plugin that does use the slow old fuzzy query but currently  
we don't support is. if you really need support for it you can open an  
issue and we can discuss it there.

simon

On Tuesday, August 13, 2013 5:31:20 PM UTC+2, Jeff Dyck wrote:

> Hmm, interesting, thanks Simon. If this is the case, is there another  
> recommended way of doing fuzzy matching with greater possible distance?
> 
> I find this a bit odd, though. I seem to remember doing fuzzy matching  
> with  
> this same type of query not too long ago and still had good results, and  
> I've not updated my version of ES in a while.
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/No-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value-tp4039516p4039571.html](http://elasticsearch-users.115913.n3.nabble.com/No-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value-tp4039516p4039571.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
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:** ![jdyck](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jdyck](https://discuss.elastic.co/u/jdyck)\
**Post date:** [August 13, 2013, 4:11pm UTC](https://discuss.elastic.co/t/no-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value/13189/5 "2013-08-13T16:11:24Z")

</div>

Ahh, okay. I'll work with it as it is for now and see if it still fits our needs. In sake of performance, I'd hope that 1-2 characters would be enough anyways.

For future reference, what version of ES introduced the new fuzzy behavior?

Thanks for your help, Simon

Jeff

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [August 14, 2013, 9:35am UTC](https://discuss.elastic.co/t/no-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value/13189/6 "2013-08-14T09:35:08Z")

</div>

This came with Lucene 4.0 so it's 0.90.0 that cut over to the fast  
FuzzyQuery FYI it's ~20k % faster (yes 20k%!)

simon

On Tuesday, August 13, 2013 6:11:24 PM UTC+2, Jeff Dyck wrote:

> Ahh, okay. I'll work with it as it is for now and see if it still fits our  
> needs. In sake of performance, I'd hope that 1-2 characters would be  
> enough  
> anyways.
> 
> For future reference, what version of ES introduced the new fuzzy  
> behavior?
> 
> Thanks for your help, Simon
> 
> Jeff
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/No-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value-tp4039516p4039575.html](http://elasticsearch-users.115913.n3.nabble.com/No-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value-tp4039516p4039575.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
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:21am UTC](https://discuss.elastic.co/t/no-results-in-fuzzy-query-string-query-with-0-01-fuzzy-min-sim-value/13189/7 "2017-07-06T02:21:14Z")

</div>


