# How to improve search results with fuzziness on?

**URL:** <https://discuss.elastic.co/t/how-to-improve-search-results-with-fuzziness-on/61803>\
**Category:** Elasticsearch\
**Created:** [September 29, 2016, 11:02am UTC](https://discuss.elastic.co/t/how-to-improve-search-results-with-fuzziness-on/61803 "2016-09-29T11:02:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkulas](https://avatars.discourse-cdn.com/v4/letter/p/7bcc69/32.png) [@pkulas](https://discuss.elastic.co/u/pkulas)\
**Post date:** [September 29, 2016, 11:02am UTC](https://discuss.elastic.co/t/how-to-improve-search-results-with-fuzziness-on/61803/1 "2016-09-29T11:02:59Z")

</div>

Hello, I'm trying to understand and improve search results.  
Analyzer use ngram min=3, max=3, language='Swedish', filter=['lowercase'].

For search fuzziness is set for 1.  
It doesn't work bad but we search for query "Frisor" and it output results with "Massör".  
Is anyone able to explain why this happen? I would like to exclude results like this but also understand why is show with fuzziness of 1, there is more different characters?

I would set some minimal score for search, but we use array with multiple words for analyzer and operator "and" so scores are pretty similar.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [September 29, 2016, 6:09pm UTC](https://discuss.elastic.co/t/how-to-improve-search-results-with-fuzziness-on/61803/2 "2016-09-29T18:09:40Z")

</div>

Could you post the actual mapping in JSON? In general using a language analyzer with ngrams is going to make things weird. And using fuzziness with ngrams is a bit odd too. I'm sure it does something, but what it does is fairly complicated.

---

<div class="post-metadata">

**Author:** ![pkulas](https://avatars.discourse-cdn.com/v4/letter/p/7bcc69/32.png) [@pkulas](https://discuss.elastic.co/u/pkulas)\
**Post date:** [September 30, 2016, 3:41pm UTC](https://discuss.elastic.co/t/how-to-improve-search-results-with-fuzziness-on/61803/3 "2016-09-30T15:41:43Z")

</div>

Mapping:

```auto
{
  "clinic" : {
    "mappings" : {
      "practitioner" : {
        "properties" : {
          "absolute_url" : {
            "type" : "string",
            "index" : "no"
          },
          "booking_last_month" : {
            "type" : "boolean"
          },
          "clinic_city" : {
            "type" : "string",
            "index" : "no"
          },
          "clinic_id" : {
            "type" : "integer"
          },
          "clinic_logo" : {
            "type" : "boolean"
          },
          "clinic_name" : {
            "type" : "string",
            "index" : "no"
          },
          "clinic_photo" : {
            "type" : "boolean"
          },
          "default_service_price" : {
            "type" : "integer"
          },
          "enabled" : {
            "type" : "boolean"
          },
          "filter_availability" : {
            "type" : "string",
            "index" : "not_analyzed"
          },
          "integration" : {
            "type" : "string",
            "index" : "not_analyzed"
          },
          "location" : {
            "type" : "geo_point"
          },
          "name" : {
            "type" : "string",
            "index" : "not_analyzed"
          },
          "pk" : {
            "type" : "long"
          },
          "practitioner_id" : {
            "type" : "integer"
          },
          "practitioner_photo" : {
            "type" : "boolean"
          },
          "q" : {
            "type" : "string",
            "analyzer" : "swedish_ngram_analyzer"
          },
          "q2" : {
            "type" : "string",
            "analyzer" : "swedish_ngram_analyzer"
          },
          "score_boost" : {
            "type" : "float"
          }
        }
      }
    }
  }
}

```

Which would be best? language analyzer + just fuzziness?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [October 1, 2016, 11:52am UTC](https://discuss.elastic.co/t/how-to-improve-search-results-with-fuzziness-on/61803/4 "2016-10-01T11:52:37Z")

</div>

The best performance is going to be just the language analyzer. Fuzziness may or may not provide better hits. It'll certainly provide _more_ hits but they might not make any sense. The usual thing to do is to run the search and use something like the phrase suggester to suggest better search terms if any are available but the phrase suggester is a bit difficult to tune effectively. Have a look at how it is tuned [here](https://en.wikipedia.org/w/index.php?search=noble+prize+winners&title=Special:Search&go=Go&searchToken=c7mqdjqlngsg24781xit6h740&cirrusDumpQuery) for a starting place.

---

<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 5, 2017, 10:15pm UTC](https://discuss.elastic.co/t/how-to-improve-search-results-with-fuzziness-on/61803/5 "2017-07-05T22:15:39Z")

</div>


