# Completion's size and total results

**URL:** <https://discuss.elastic.co/t/completions-size-and-total-results/43778>\
**Category:** Elasticsearch\
**Created:** [March 8, 2016, 1:48pm UTC](https://discuss.elastic.co/t/completions-size-and-total-results/43778 "2016-03-08T13:48:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dalen/32/8347_2.png) [@dalen](https://discuss.elastic.co/u/dalen)\
**Post date:** [March 8, 2016, 1:48pm UTC](https://discuss.elastic.co/t/completions-size-and-total-results/43778/1 "2016-03-08T13:48:10Z")

</div>

Elastic Search allows to set a size in completion suggest.  
Is there a way to get the total number of options the query would return before applying the size limit?

Example:

**request:**

> ```
> {
> text: "John",
> completion: {
> size: 3,
> field: "suggestion"
> }
> }
> 
> ```

**actual result:**

> ```
> {
> "text": "John",
> "offset": 0,
> "length": 4,
> "options": [
> {
> "text": "John Doe",
> "score": 1,
> "payload": { "id" : 1 }
> },
> {
> "text": "John Doe Jr.",
> "score": 1,
> "payload": { "id" : 2 }
> },
> {
> "text": "John Doe III",
> "score": 1,
> "payload": { "id" : 3 }
> },
> ]
> }
> 
> ```

**result I'd like:**

> ```
> {
> "text": "John",
> "offset": 0,
> "length": 4,
> "total": 32, //means that "John" would produce 32 results but since size=3 only 3 are listed
> "options": [
> {
> "text": "John Doe",
> "score": 1,
> "payload": { "id" : 1 }
> },
> {
> "text": "John Doe Jr.",
> "score": 1,
> "payload": { "id" : 2 }
> },
> {
> "text": "John Doe III",
> "score": 1,
> "payload": { "id" : 3 }
> },
> ]
> }
> 
> ```

---

<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:** [July 5, 2017, 11:10pm UTC](https://discuss.elastic.co/t/completions-size-and-total-results/43778/2 "2017-07-05T23:10:21Z")

</div>


