# Completion suggester returning non-deterministic results?

**URL:** <https://discuss.elastic.co/t/completion-suggester-returning-non-deterministic-results/287834>\
**Category:** Elasticsearch\
**Created:** [October 27, 2021, 5:02pm UTC](https://discuss.elastic.co/t/completion-suggester-returning-non-deterministic-results/287834 "2021-10-27T17:02:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tallison](https://avatars.discourse-cdn.com/v4/letter/t/258eb7/32.png) [@tallison](https://discuss.elastic.co/u/tallison)\
**Post date:** [October 27, 2021, 5:02pm UTC](https://discuss.elastic.co/t/completion-suggester-returning-non-deterministic-results/287834/1 "2021-10-27T17:02:20Z")

</div>

When I run a completion suggester I'm getting different results each time I send the same query over the same static data.

I realize that this may be an optimization for search...because users don't always need all the completions. 😃

This is on a vintage 7.1.1 with two shards, and I'm always getting success on both shards.

I'm looking for terms that start with "/FontIdentifier-\>"

I know from the data that I should be getting at least: /FontIdentifier-\>/Checksum, /FontIdentifier-\>/Family, /FontIdentifier-\>/Foundry, /FontIdentifier-\>/Kind, /FontIdentifier-\>/Type, /FontIdentifier-\>/Version

The results I'm seeing, though, generally contain 3 items, normally always /FontIdentifier-\>/Checksum, but then sometimes /FontIdentifier-\>/Foundry or /FontIdentifier-\>/Type or something else.

Each document that contains /FontIdentifier should roughly have all of the above. I'm storing each value as a keyword in a multi-valued field (see below).

This is the query:

```auto
GET file-observatory-eval-three-20210806/_search
{
  "_source": false,
  "suggest": {
    "fontIdentifier": {
      "prefix": "/FontIdentifier->",
      "completion": {
        "field": "q_parent_and_keys.completion",
        "size": 1000000,
        "skip_duplicates": true
      }
    }
  }
}

```

This is the config for this field:

```auto
      "q_parent_and_keys": {
        "type": "keyword",
        "store": "true",
        "fields": {
          "case": {
            "type": "keyword",
            "normalizer": "lc_normalizer"
          },
          "completion": {
            "type": "completion",
            "analyzer": "whitespace"
          }
        }
      },

```

Is this a bug or a feature? Is there anything I can do with the schema or how I'm indexing the data to get what I need?

Or, is there an alternative way outside of the suggester to get all terms that match a prefixquery?

---

<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:** [November 24, 2021, 5:02pm UTC](https://discuss.elastic.co/t/completion-suggester-returning-non-deterministic-results/287834/2 "2021-11-24T17:02:47Z")

</div>

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