# Suggester not returning and hits

**URL:** <https://discuss.elastic.co/t/suggester-not-returning-and-hits/255231>\
**Category:** Elasticsearch\
**Created:** [November 12, 2020, 3:19pm UTC](https://discuss.elastic.co/t/suggester-not-returning-and-hits/255231 "2020-11-12T15:19:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bart\_de\_Man](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bart_de_man/32/48319_2.png) [@Bart\_de\_Man](https://discuss.elastic.co/u/Bart_de_Man)\
**Post date:** [November 12, 2020, 3:19pm UTC](https://discuss.elastic.co/t/suggester-not-returning-and-hits/255231/1 "2020-11-12T15:19:45Z")

</div>

**Elasticsearch version** ( `bin/elasticsearch --version` ):  
5.6.11  
**Plugins installed** :

**JVM version** ( `java -version` ):  
openjdk version "1.8.0\_222"  
OpenJDK Runtime Environment (build 1.8.0\_222-8u222-b10-1ubuntu1~16.04.1-b10)  
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

**OS version** ( `uname -a` if on a Unix-like system):  
Linux myserver 4.4.0-131-generic #157-Ubuntu SMP Thu Jul 12 15:51:36 UTC 2018 x86\_64 x86\_64 x86\_64 GNU/Linux

**Description of the problem including expected versus actual behavior** :  
I'm trying to learn and use suggesters and stumbled upon the phrase suggester which seems most appropriate for my case where the order of the terms by the user shouldn't matter.

My mapping/index/etc.

```auto
  "my_special_index": {
    "aliases": {},
    "mappings": {
      "my_special_index": {
        "properties": {
          "books": {
            "type": "nested",
            "properties": {
              "name": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  },
                  "trigram": {
                    "type": "text",
                    "analyzer": "trigram"
                  }
                }
              }
            }
          }
        }
      }
    },
    "settings": {
      "index": {
        "number_of_shards": "5",
        "provided_name": "my_special_index",
        "creation_date": "1605193127758",
        "analysis": {
          "filter": {
            "shingle": {
              "max_shingle_size": "3",
              "min_shingle_size": "2",
              "type": "shingle"
            }
          },
          "normalizer": {
            "lowerasciinormalizer": {
              "filter": "lowercase,asciifolding",
              "type": "custom"
            }
          },
          "analyzer": {
            "trigram": {
              "filter": [
                "shingle",
                "lowercase"
              ],
              "type": "custom",
              "tokenizer": "standard"
            }
          },
          "tokenizer": {
            "autocomplete": {
              "token_chars": [
                "letter"
              ],
              "min_gram": "2",
              "type": "edge_ngram",
              "max_gram": "10"
            }
          }
        },
        "number_of_replicas": "1",
        "uuid": "xasdasdad",
        "version": {
          "created": "5061699"
        }
      }
    }
  }
}

```

How i'm querying ES:

```auto
GET my_special_index/_search
{
  "suggest": {
    "text": "harry potter and the",
    "phrase_fixer": {
      "phrase": {
        "field": "books.name.trigram"
      }
    }
  }
}

```

output:

```auto
{
  "took": 26,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 0,
    "max_score": 0,
    "hits": []
  },
  "suggest": {
    "phrase_fixer": [
      {
        "text": "harry potter and the",
        "offset": 0,
        "length": 20,
        "options": []
      }
    ]
  }
}

```

Can anyone see what I might be missing?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Bart\_de\_Man](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bart_de_man/32/48319_2.png) [@Bart\_de\_Man](https://discuss.elastic.co/u/Bart_de_Man)\
**Post date:** [November 25, 2020, 1:49pm UTC](https://discuss.elastic.co/t/suggester-not-returning-and-hits/255231/2 "2020-11-25T13:49:28Z")

</div>

Solved it by creating a separate index with just the names

---

<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 23, 2020, 1:49pm UTC](https://discuss.elastic.co/t/suggester-not-returning-and-hits/255231/3 "2020-12-23T13:49:31Z")

</div>

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