# Question regarding the parameter max\_term\_freq in term suggester

**URL:** https://discuss.elastic.co/t/question-regarding-the-parameter-max-term-freq-in-term-suggester/347334
**Category:** Elasticsearch
**Created:** [November 16, 2023, 1:04pm UTC](https://discuss.elastic.co/t/question-regarding-the-parameter-max-term-freq-in-term-suggester/347334 "2023-11-16T13:04:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![qwertzu](https://avatars.discourse-cdn.com/v4/letter/q/85f322/32.png) [@qwertzu](https://discuss.elastic.co/u/qwertzu)
#### Post date: [November 16, 2023, 1:04pm UTC](https://discuss.elastic.co/t/question-regarding-the-parameter-max-term-freq-in-term-suggester/347334/1 "2023-11-16T13:04:49Z")

</div>

Howdy,

I am new to the ES community so feel free to criticize my rookie mistakes. Currently I am playing around the term suggester and stumbled across the following behavior that seems counter intuitive:

Here is the code to generate a minimal working example:

```auto
POST max-term-freq-test/_bulk?refresh=true
{ "index": { "_id": "0" } }
{ "tags": ["hundred"] }
{ "index": { "_id": "1" } }
{ "tags": ["hundred", "eighty"] }
{ "index": { "_id": "2" } }
{ "tags": ["hundred", "eighty", "sixty"] }
{ "index": { "_id": "3" } }
{ "tags": ["hundred", "eighty", "sixty", "forty"] }
{ "index": { "_id": "4" } }
{ "tags": ["hundred", "eighty", "sixty", "forty", "twenty"] }

POST /max-term-freq-test/_search
{
  "suggest" : {
          "my-suggestion" : {
            "text" : "fourti",
            "term" : {
              "field" : "tags",
              "size" : 8,
              "suggest_mode" : "always",
              "min_word_length" : 3,
              "max_term_freq" : 0.5
            }
          }
  }
}

```

What happens:  
The suggester proposes the word "fourty" independently of the value for max\_term\_freq.

What I expect:  
If the value for max\_term\_freq is set too high (e.g. 0.5) the suggester should not be able to find the words that appear too frequently (in this case in \>=50% of all documents).

Thank you in advance

PS: I am using ES 8.8.2

---

<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: [December 14, 2023, 1:05pm UTC](https://discuss.elastic.co/t/question-regarding-the-parameter-max-term-freq-in-term-suggester/347334/2 "2023-12-14T13:05:17Z")

</div>

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