# Incorrect behaviour of fuzzing parameters with completion suggester

**URL:** <https://discuss.elastic.co/t/incorrect-behaviour-of-fuzzing-parameters-with-completion-suggester/357455>\
**Category:** Elasticsearch\
**Created:** [April 15, 2024, 7:23pm UTC](https://discuss.elastic.co/t/incorrect-behaviour-of-fuzzing-parameters-with-completion-suggester/357455 "2024-04-15T19:23:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pigeon\_gcc](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pigeon\_gcc](https://discuss.elastic.co/u/pigeon_gcc)\
**Post date:** [April 15, 2024, 7:23pm UTC](https://discuss.elastic.co/t/incorrect-behaviour-of-fuzzing-parameters-with-completion-suggester/357455/1 "2024-04-15T19:23:08Z")

</div>

I use fuzzing in my quries to completion suggester. It seems like `min_length` and `fuzziness` parameters of the query can't agree between each other.

The parameters are described [in the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#fuzzy)

**Example 1:** `"min_length": 5, "fuzziness": "AUTO:5,8"`

- **query** : `conte-`  
**expected** : query length is 6, we're expecting 1 correction (dash to be removed)  
**result** : `contemporary` is suggested, everything's ok ✅

- **query** : `contempo--`  
**expected** : query length is 10, we're expecting 2 corrections  
**result** : nothing is suggested, incorrect behaviour ❌

**Example 2:** `"min_length": 1, "fuzziness": "AUTO:2,5"`

- **query** : `co-`  
**expected** : query length is 3, we're expecting 1 correction  
**result** : `contemporary` and `cheese` are suggested, we have 2 corrections in the cheese case ❌

- **query** : `contempo--`  
**expected** : query length is 10, we're expecting 2 corrections  
**result** : `contemporary` is suggested, everything's ok ✅

The problem is reproducible with ES 8.6.2 and 8.8.2.

My configuration is as follows. **Mapping** :

```auto
{
    "mappings": {
        "properties": {
            "query": {
                "type": "completion",
                "analyzer": "autocomplete_analyzer",
                "search_analyzer": "autocomplete_search_analyzer"
            },
        }
    }
}

```

**Query** :

```auto
{
    "suggest": {
        "text-suggest": {
        "prefix": "conte-",
        "completion": {
            "field": "query",
            "fuzzy": {
                "fuzziness": "AUTO:5,8",
                "min_length": 5,
                "unicode_aware": True
            },
            "size": 4
            }
        }
    }
}

```

Could anyone help with the issue? Probably this needs a bug confirmation. I would appreciate any help!
