# Inconsistent behaviour of Fuzziness for Completion Suggester

**URL:** <https://discuss.elastic.co/t/inconsistent-behaviour-of-fuzziness-for-completion-suggester/147229>\
**Category:** Elasticsearch\
**Created:** [September 4, 2018, 2:08pm UTC](https://discuss.elastic.co/t/inconsistent-behaviour-of-fuzziness-for-completion-suggester/147229 "2018-09-04T14:08:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karandeep\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karandeep_singh/32/35144_2.png) [@Karandeep\_Singh](https://discuss.elastic.co/u/Karandeep_Singh)\
**Post date:** [September 4, 2018, 2:08pm UTC](https://discuss.elastic.co/t/inconsistent-behaviour-of-fuzziness-for-completion-suggester/147229/1 "2018-09-04T14:08:41Z")

</div>

Hello,

Please see the below (ES Version : 6.2.3):

1. Mapping:

```auto
 PUT /demo_suggestions
{
  "settings": {
    "analysis": {
      "analyzer": {
        "custom_analyzer_with_edge_ngram_filter": {
          "tokenizer": "standard",
          "char_filter": [
            "html_strip"
          ],
          "filter": [
            "lowercase",
            "asciifolding",
            "trim",
            "classic",
            "unique",
            "custom_edge_ngram_filter"
          ]
        }
      },
      "filter": {
        "custom_edge_ngram_filter": {
          "type": "edge_ngram",
          "min_gram": 1,
          "max_gram": 10
        }
      }
    }
  },
  "mappings": {
    "_doc": {
      "properties": {
        "suggest": {
          "type": "completion"
        },
        "query_string": {
          "type": "keyword",
          "fields": {
            "edge_ngram_filter": {
              "type": "text",
              "analyzer": "custom_analyzer_with_edge_ngram_filter",
              "search_analyzer": "standard"
            }
          }
        }
      }
    }
  }
}   

```

1. Data

```auto
    PUT /demo_suggestions/_doc/1?refresh
            {
                "suggest" : {
                    "input": ["crime"]
                },
                "query_string": "crime"
            }

```

1. Query

2. Response

Why is it that the hits is empty and the suggest has a result? IMHO, since fuzziness is defined as "AUTO:5,8" it should not look for fuzzy results on query strings of length less than 5 chars. Both, hits and suggest section should be empty. The problem disappears when the "min\_length" is increased to 6 for suggest query. Please advise.

---

<div class="post-metadata">

**Author:** ![Karandeep\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karandeep_singh/32/35144_2.png) [@Karandeep\_Singh](https://discuss.elastic.co/u/Karandeep_Singh)\
**Post date:** [September 24, 2018, 9:45am UTC](https://discuss.elastic.co/t/inconsistent-behaviour-of-fuzziness-for-completion-suggester/147229/2 "2018-09-24T09:45:41Z")

</div>

I have not been able to understand this behaviour. Any help will be appreciated.

---

<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:** [October 22, 2018, 9:45am UTC](https://discuss.elastic.co/t/inconsistent-behaviour-of-fuzziness-for-completion-suggester/147229/3 "2018-10-22T09:45:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
