# Completion suggester returning less number of results

**URL:** <https://discuss.elastic.co/t/completion-suggester-returning-less-number-of-results/92812>\
**Category:** Elasticsearch\
**Created:** [July 12, 2017, 1:11pm UTC](https://discuss.elastic.co/t/completion-suggester-returning-less-number-of-results/92812 "2017-07-12T13:11:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pratik\_Vasa](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@Pratik\_Vasa](https://discuss.elastic.co/u/Pratik_Vasa)\
**Post date:** [July 12, 2017, 1:11pm UTC](https://discuss.elastic.co/t/completion-suggester-returning-less-number-of-results/92812/1 "2017-07-12T13:11:49Z")

</div>

**Elasticsearch version** : 5.4.3

**JVM version** : 1.8

**OS version** : ubuntu 14.04

I created an index with the following mapping.

```
          "areadocument": {
             "properties": {
                "areaSuggests": {
                   "type": "completion",
                   "analyzer": "standard",
                   "preserve_separators": false,
                   "preserve_position_increments": true,
                   "max_input_length": 50,
                   "contexts": [
                      {
                         "name": "category",
                         "type": "CATEGORY",
                         "path": "areaSuggests.contexts.category"
                      }
                   ]
                },
                "id": {
                   "type": "keyword"
                },
                "output": {
                   "type": "keyword"
                }

```

The problem is that the suggest query is returning less number of results.

When I query for a size of 5 documents, it returns 2 documents for a prefix.  
When I run the same query with a asking size of 10, it returns 3 documents.

The following is the query:

```
 {
    "suggest": {
       "suggestions": {
          "prefix": "and",
          "completion": {
             "field": "areaSuggests",
             "size": 5,
             "contexts": {
                "category": ["1"]
             }
          }
       }
    }
 }

```

Shouldn't the query with a size of 5 also return 3 results. Am I missing something?

---

<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:** [August 9, 2017, 1:11pm UTC](https://discuss.elastic.co/t/completion-suggester-returning-less-number-of-results/92812/2 "2017-08-09T13:11:52Z")

</div>

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