# Inconsistent completion suggester results size

**URL:** <https://discuss.elastic.co/t/inconsistent-completion-suggester-results-size/280807>\
**Category:** Elasticsearch\
**Created:** [August 9, 2021, 12:05pm UTC](https://discuss.elastic.co/t/inconsistent-completion-suggester-results-size/280807 "2021-08-09T12:05:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abido](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abido/32/92697_2.png) [@abido](https://discuss.elastic.co/u/abido)\
**Post date:** [August 9, 2021, 12:05pm UTC](https://discuss.elastic.co/t/inconsistent-completion-suggester-results-size/280807/1 "2021-08-09T12:05:09Z")

</div>

Hello,

I am getting weird behaviour with the number of results returned by the `Completion Suggester`.

I have the following request body for example:

```auto
"suggest": {
  "title": {
    "prefix": "ja",
    "completion": {
      "field": "suggest",
      "size": 10
    }
  }
}

```

If the index has only 1 shard (`"number_of_shards": 1`), I sometimes get the size I specify, and sometimes less, depending on my luck.

For example, for a specific search I know for fact there are +50 matches, but if I use `size=10` I get 9 or 10, and `size=30` randomly returns 19 or 30.

If I increase the number of shards of this index, it starts behaving correctly and returns all the available results while respecting the `size` parameter, i.e. if I pass 30 for the size, I get back 30 results back. But if it's only 1 shard, things are quite random.

I would like to understand the reason why this happens before I just increase the number of shards. Especially that according to the documentation, it is recommended to use a single shard:

> _"To get best performance for completions, it is recommended to index completions into a single shard index"_  
> [Suggesters | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html)

I am using v7.12.

---

<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 6, 2021, 12:05pm UTC](https://discuss.elastic.co/t/inconsistent-completion-suggester-results-size/280807/2 "2021-09-06T12:05:30Z")

</div>

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