# How to reorder fuzzy search results

**URL:** <https://discuss.elastic.co/t/how-to-reorder-fuzzy-search-results/13548>\
**Category:** Elasticsearch\
**Created:** [September 11, 2013, 8:00am UTC](https://discuss.elastic.co/t/how-to-reorder-fuzzy-search-results/13548 "2013-09-11T08:00:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Makanju\_Dami\_Perfect](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/makanju_dami_perfect/32/2187_2.png) [@Makanju\_Dami\_Perfect](https://discuss.elastic.co/u/Makanju_Dami_Perfect)\
**Post date:** [September 11, 2013, 8:00am UTC](https://discuss.elastic.co/t/how-to-reorder-fuzzy-search-results/13548/1 "2013-09-11T08:00:03Z")

</div>

Hello,

I'm trying to create a correction search for one of my projects. And i'm  
currently using fuzzy search, but the scoring of the results are not  
helpful.

For example, when i do this search:

curl XPOST [http://localhost:9200/deals/hotels/\_search](http://localhost:9200/deals/hotels/_search)  
{  
"from":0,  
"size":7,  
"query":{"fuzzy":{"hotelname":"wise"}}  
}

I get the following results:

Mike White Hotels - score:\* 2.9329195\*  
Think Twice - score:\* 2.756144\*  
White House Hotel - score: _2.2049153_  
Nice Time Hotel - score: _2.065069_  
De Wise Hotel Odo Ona - score: _1.9627647_  
Under The Wave - score: _1.6577798_  
\*  
\*  
The result is fine, but i need the ordering to be better, that is, I need  
'De Wise Hotel' to be matched first with a higher score before other fuzzy  
calculated results.

I'm new to elastic search, so your help would be greatly appreciated.

--  
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:** ![Mark\_Harwood1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood1/32/101255_2.png) [@Mark\_Harwood1](https://discuss.elastic.co/u/Mark_Harwood1)\
**Post date:** [September 11, 2013, 2:19pm UTC](https://discuss.elastic.co/t/how-to-reorder-fuzzy-search-results/13548/2 "2013-09-11T14:19:37Z")

</div>

See [Fuzzy query ranks typos over exact matches · Issue #3125 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/3125)

I expect this is down to a core Lucene issue in that the default FuzzyQuery  
class has a bias towards rare terms rather than good matches. I addressed  
this problem with the "FuzzyLikeThis" alternative Query class.  
Elasticsearch docs for this alternative are here

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

I haven't tried this in ES but I have generally found FLT provides saner  
ranking of results.

Cheers  
Mark

On Wednesday, September 11, 2013 9:00:03 AM UTC+1, Makanju Dami Perfect  
wrote:

> Hello,
> 
> I'm trying to create a correction search for one of my projects. And i'm  
> currently using fuzzy search, but the scoring of the results are not  
> helpful.
> 
> For example, when i do this search:
> 
> curl XPOST [http://localhost:9200/deals/hotels/\_search](http://localhost:9200/deals/hotels/_search)  
> {  
> "from":0,  
> "size":7,  
> "query":{"fuzzy":{"hotelname":"wise"}}  
> }
> 
> I get the following results:
> 
> Mike White Hotels - score:\* 2.9329195\*  
> Think Twice - score:\* 2.756144\*  
> White House Hotel - score: _2.2049153_  
> Nice Time Hotel - score: _2.065069_  
> De Wise Hotel Odo Ona - score: _1.9627647_  
> Under The Wave - score: _1.6577798_  
> \*  
> \*  
> The result is fine, but i need the ordering to be better, that is, I need  
> 'De Wise Hotel' to be matched first with a higher score before other fuzzy  
> calculated results.
> 
> I'm new to Elasticsearch, so your help would be greatly appreciated.

--  
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:** ![marker](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@marker](https://discuss.elastic.co/u/marker)\
**Post date:** [December 28, 2013, 2:14am UTC](https://discuss.elastic.co/t/how-to-reorder-fuzzy-search-results/13548/3 "2013-12-28T02:14:14Z")

</div>

Any luck doing with that? I have reviewed the links provided. However, no luck.

---

<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, 1:59am UTC](https://discuss.elastic.co/t/how-to-reorder-fuzzy-search-results/13548/4 "2017-07-06T01:59:12Z")

</div>


