# Suggest: No results with anything I've tried (term, phrase, simple\_phrase, collate)

**URL:** <https://discuss.elastic.co/t/suggest-no-results-with-anything-ive-tried-term-phrase-simple-phrase-collate/266159>\
**Category:** Elasticsearch\
**Created:** [March 3, 2021, 8:57pm UTC](https://discuss.elastic.co/t/suggest-no-results-with-anything-ive-tried-term-phrase-simple-phrase-collate/266159 "2021-03-03T20:57:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Petersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_petersen/32/84916_2.png) [@Mark\_Petersen](https://discuss.elastic.co/u/Mark_Petersen)\
**Post date:** [March 3, 2021, 8:57pm UTC](https://discuss.elastic.co/t/suggest-no-results-with-anything-ive-tried-term-phrase-simple-phrase-collate/266159/1 "2021-03-03T20:57:06Z")

</div>

Hi everyone, I'm new to Elasticsearch and I've been trying for some time to get a suggest search to return me anything at all and I really need help.

**Requirement**  
Suggest article titles based on incomplete or misspelled input, where the input could appear anywhere in the title. The order of the words in the title may not be well-known.

Here is where I am right now:

**Index**

```auto
PUT /item
{
  "settings": {
    "index": {
      "analysis": {
        "filter": {
          "edge_ngram_filter": {
            "type": "edge_ngram",
            "min_gram": "1",
            "max_gram": "10"
          },
          "suggest_shingle_filter": {
            "type": "shingle",
            "min_shingle_size": 2,
            "max_shingle_size": 10
          }
        },
        "analyzer": {
          "suggest_token_analyzer": {
            "tokenizer": "standard",
            "type": "custom",
            "filter": [
              "lowercase",
              "asciifolding",
              "edge_ngram_filter",
              "stop"
            ]
          },
          "suggest_shingle_analyzer": {
            "type": "custom",
            "tokenizer": "standard",
            "filter": [
              "lowercase",
              "suggest_shingle_filter"
            ]
          }
        }
      }
    },
    "max_ngram_diff": "10",
    "max_shingle_diff": 10
  },
  "mappings": {
    "properties": {
      "title_suggest": {
        "type": "text",
        "analyzer": "suggest_token_analyzer",
        "fields": {
          "shingle": {
            "type": "text",
            "analyzer": "suggest_shingle_analyzer"
          },
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      }
    }
  }
}

```

**Populate Index**

```auto
PUT /item/_doc/1
{
  "title_suggest": "Diabetes"
}

PUT /item/_doc/2
{
  "title_suggest": "Diabetes Mellitus"
}

PUT /item/_doc/3
{
  "title_suggest": "Diabetes Mellitus Type 1"
}

```

**Attempted suggests (they all do nothing)**

```auto
GET /item/_search
{
  "suggest": {
    "YOUR_SUGGESTION": {
      "text": "Diabetes",
      "term": {
        "field": "title_suggest"
      }
    }
  }
}

GET /item/_search
{
  "suggest": {
    "YOUR_SUGGESTION": {
      "text": "Diabetes",
      "term": {
        "field": "title_suggest.shingle"
      }
    }
  }
}

GET item/_search
{
  "suggest": {
    "text": "dia",
    "simple_phrase": {
      "phrase": {
        "field": "title_suggest",
        "confidence": 0.0,
        "direct_generator": [
          {
            "field": "title_suggest"
          }
        ],
        "collate": {
          "query": {
            "source": {
              "match": {
                "title": {
                  "query": "{{suggestion}}",
                  "fuzziness": "2",
                  "operator": "and"
                }
              }
            }
          },
          "prune": "true"
        }
      }
    }
  }
}

```

**Desired results**  
I should be able to:

1. Type in "D" and get all 3 items returned
2. Type in "Diabetes" and get all 3 items returned
3. Type in "Diabeetus" and get all 3 items returned
4. Type in "Mel" and get "Diabetes Mellitus" and "Diabetes Mellitus Type 1" returned  
And so on...

Can someone please help me figure out what I'm doing wrong or point me in the right direction?

Thanks in advance!

---

<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:** [March 31, 2021, 8:57pm UTC](https://discuss.elastic.co/t/suggest-no-results-with-anything-ive-tried-term-phrase-simple-phrase-collate/266159/2 "2021-03-31T20:57:49Z")

</div>

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