# Significant Terms with multi word results

**URL:** <https://discuss.elastic.co/t/significant-terms-with-multi-word-results/281394>\
**Category:** Elasticsearch\
**Created:** [August 13, 2021, 5:22pm UTC](https://discuss.elastic.co/t/significant-terms-with-multi-word-results/281394 "2021-08-13T17:22:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barrett\_Jones](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/barrett_jones/32/92997_2.png) [@Barrett\_Jones](https://discuss.elastic.co/u/Barrett_Jones)\
**Post date:** [August 13, 2021, 5:22pm UTC](https://discuss.elastic.co/t/significant-terms-with-multi-word-results/281394/1 "2021-08-13T17:22:45Z")

</div>

I have an ElasticSearch index that includes a "text" field that I would like to do ElasticSearch significant\_terms aggregation on to determine meaningful terms and phrases from the "text" field. The problem I am facing, is the results are never a phrase, but instead always a one word term. The results may return something like: 'health' & 'care', but never 'health care'.

If anyone can please help me understand what I could be doing wrong.

Here is an example of my mapping:

```auto
{
  "mappings" : {
    "properties" : {
      "keyword" : {
        "type" : "text",
        "fields" : {
          "keyword" : {
            "type" : "keyword",
            "ignore_above" : 256
          }
        }
      },
      "text" : {
        "type" : "text",
        "fields" : {
          "keyword" : {
            "type" : "keyword",
            "ignore_above" : 256
          }
        },
        "fielddata": true,
        "index_phrases": true
      }
    }
  }
}

```

Here is an example of query to get significant terms:

```auto
{
  "query": {
    "bool": {
      "must": [
        {
          "match_phrase": {
            "keyword" : "health care"
          }
        }
      ]
    }
  },
  "size": 0,
  "aggs": {
      "test": {
        "significant_terms": {
          "field": "text"
        }
      }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [August 13, 2021, 10:07pm UTC](https://discuss.elastic.co/t/significant-terms-with-multi-word-results/281394/2 "2021-08-13T22:07:02Z")

</div>

Two things:

1. use the significant\_text aggregation on text fields (along with the sampler aggregation to focus on just the top matches)
2. Index your text using 2 word shingles to get phrases in results

---

<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:** [September 10, 2021, 10:07pm UTC](https://discuss.elastic.co/t/significant-terms-with-multi-word-results/281394/3 "2021-09-10T22:07:45Z")

</div>

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