# Term suggester returning correct suggestions for misspelled words outside of suggester data source

**URL:** <https://discuss.elastic.co/t/term-suggester-returning-correct-suggestions-for-misspelled-words-outside-of-suggester-data-source/333083>\
**Category:** Elasticsearch\
**Created:** [May 10, 2023, 12:26pm UTC](https://discuss.elastic.co/t/term-suggester-returning-correct-suggestions-for-misspelled-words-outside-of-suggester-data-source/333083 "2023-05-10T12:26:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MilanGatyas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/milangatyas/32/81894_2.png) [@MilanGatyas](https://discuss.elastic.co/u/MilanGatyas)\
**Post date:** [May 10, 2023, 12:26pm UTC](https://discuss.elastic.co/t/term-suggester-returning-correct-suggestions-for-misspelled-words-outside-of-suggester-data-source/333083/1 "2023-05-10T12:26:07Z")

</div>

Please help me understand why this happens. We use Elasticsearch 7.10 term suggester. The field `didYouMean.trigram` we use for the suggestions has the following mapping

```auto
"didYouMean" : {
  "type" : "text",
  "fields" : {
    "trigram" : {
      "type" : "text",
      "analyzer" : "trigram"
    }    
  }
}

```

`trigram` analyzer definition

```auto
"trigram" : {
  "filter" : ["lowercase", "asciifolding", "shingle"],
  "type" : "custom",
  "tokenizer" : "standard"
},

```

`shingle` token filter definition

```auto
"shingle" : {
  "max_shingle_size" : "3",
  "min_shingle_size" : "2",
  "type" : "shingle"
},

```

The actual term suggest query looks like

```auto
"suggest": {
  "didYouMeanSuggestTerm":{
    "term": {
      "min_word_length":3,
      "suggest_mode":"popular",
      "field":"didYouMean.trigram"
    },
    "text":"<my query>"
  }
}

```

The confusing part is that `didYouMeanSuggestTerm` is giving me good corrections of words such as `earing` -\> `earring` or `jewelery` into `jewellery`, even though `earring` nor `jewellery` is part of the data indexed under `didYouMean.trigram`.

It looks to me (and ChatGPT) as if the term suggester is using fuzziness and something more to suggest words out of the data source available for the suggester, however I did not found any information about this behavior in the documentation.

Can someone help me understand how term suggester is able to pull up these corrections?

---

<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:** [June 7, 2023, 12:26pm UTC](https://discuss.elastic.co/t/term-suggester-returning-correct-suggestions-for-misspelled-words-outside-of-suggester-data-source/333083/2 "2023-06-07T12:26:39Z")

</div>

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