# How does the cutoff\_frequency work on the match query

**URL:** <https://discuss.elastic.co/t/how-does-the-cutoff-frequency-work-on-the-match-query/80694>\
**Category:** Elasticsearch\
**Created:** [March 30, 2017, 2:28pm UTC](https://discuss.elastic.co/t/how-does-the-cutoff-frequency-work-on-the-match-query/80694 "2017-03-30T14:28:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martijn\_Laarman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martijn_laarman/32/4410_2.png) [@Martijn\_Laarman](https://discuss.elastic.co/u/Martijn_Laarman)\
**Post date:** [March 30, 2017, 2:28pm UTC](https://discuss.elastic.co/t/how-does-the-cutoff-frequency-work-on-the-match-query/80694/1 "2017-03-30T14:28:58Z")

</div>

Given the following sense session:

```
DELETE /my-index

PUT my-index
{
  "settings": {
    "number_of_replicas": 0,
    "number_of_shards": 1
  }
}

PUT /my-index/search_item/1
{
  "title" : " the car",
  "type": "article"
}

PUT /my-index/search_item/2
{
  "title" : "the the building",
  "type": "calculator"
}

PUT /my-index/search_item/3?refresh
{
  "title" : "the kibana rises, the world rejoices",
  "type": "calculator"
}

GET /my-index/search_item/2/_termvectors?fields=title

POST /my-index/_search
{
  "query" : {
    "match" : {
      "title" : {
        "query" : "the kibana "
        , "cutoff_frequency": 2
        , "operator": "or"
      }
    }
  },
  "explain": true
}

```

A `cutoff_frequency` off `2` returns `1` document but changing `cutoff_frequency` to `3` yields `3`.  
documents.

Since I am expecting it to yield `0` documents in the latter case makes me suspect that I do not fully understand this feature to dynamically ignore high frequency terms.

As a side note `explain: true` does not return info (maybe by design) to help diagnose whats going on.

Anyone with intimate knowledge of its execution able to guide me through it?

---

<div class="post-metadata">

**Author:** ![Karolinebryn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karolinebryn/32/17095_2.png) [@Karolinebryn](https://discuss.elastic.co/u/Karolinebryn)\
**Post date:** [April 5, 2017, 9:42am UTC](https://discuss.elastic.co/t/how-does-the-cutoff-frequency-work-on-the-match-query/80694/2 "2017-04-05T09:42:27Z")

</div>

Still no answer to this question?  
I just can't get my head around how the cutoff\_frequency works 😞

---

<div class="post-metadata">

**Author:** ![Karolinebryn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karolinebryn/32/17095_2.png) [@Karolinebryn](https://discuss.elastic.co/u/Karolinebryn)\
**Post date:** [April 18, 2017, 11:27am UTC](https://discuss.elastic.co/t/how-does-the-cutoff-frequency-work-on-the-match-query/80694/3 "2017-04-18T11:27:52Z")

</div>

I've read [this](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#query-dsl-match-query-cutoff) and [this](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/query-dsl-common-terms-query.html) documentation several times now, and I think I know the solution to this problem (although it is not specified in the documentation as far as I can see).

I think that cutoff\_frequency: 3 means the term must be in MORE than 3 documents. Meaning that in your scenario "the" will no longer be a high frequency word, because it is 3 documents exactly.

---

<div class="post-metadata">

**Author:** ![Martijn\_Laarman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martijn_laarman/32/4410_2.png) [@Martijn\_Laarman](https://discuss.elastic.co/u/Martijn_Laarman)\
**Post date:** [May 16, 2017, 11:28am UTC](https://discuss.elastic.co/t/how-does-the-cutoff-frequency-work-on-the-match-query/80694/4 "2017-05-16T11:28:30Z")

</div>

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