# Completion Suggestion Not working as documented

**URL:** <https://discuss.elastic.co/t/completion-suggestion-not-working-as-documented/19036>\
**Category:** Elasticsearch\
**Created:** [August 1, 2014, 4:18pm UTC](https://discuss.elastic.co/t/completion-suggestion-not-working-as-documented/19036 "2014-08-01T16:18:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madhavan\_Ramachandra](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Madhavan\_Ramachandra](https://discuss.elastic.co/u/Madhavan_Ramachandra)\
**Post date:** [August 1, 2014, 4:18pm UTC](https://discuss.elastic.co/t/completion-suggestion-not-working-as-documented/19036/1 "2014-08-01T16:18:04Z")

</div>

Hi All,

I am new to Elastic Search. I try to implement the completion suggester as  
documented in "[http://www.elasticsearch.org/blog/you-complete-me/](http://www.elasticsearch.org/blog/you-complete-me/)" with  
sample data as below. Instead of hotel.. i choose region and locations..

us-en-us-chicago  
us-en-us-chicago, central loop  
us-en-us-chicago, east loop  
us-en-us-chicago, eastern east-west  
us-en-us-chicago, i-80 & i-55 corridors  
us-en-us-chicago, i-90 corridor  
us-en-us-chicago, north (cook county)  
us-en-us-chicago, north (lake county)  
us-en-us-chicago, north i-94 corridor  
us-en-us-chicago, north michigan avenue  
us-en-us-chicago, northwest  
us-en-us-chicago, northwest indiana  
us-en-us-chicago, o'hare  
us-en-us-chicago, river north  
us-en-us-chicago, west loop  
us-en-us-chicago, western east-west

I am using POSTMAN, a chrome extension to create and query from Elastic  
Search. I created Index using POSTMAN tool

PUT : [http://localhost/typeahead](http://localhost/typeahead)  
{  
"mappings": {  
"search" : {  
"properties" : {  
"search" : {  
"type" : "completion"  
}  
}  
}  
}  
}

Indexed the above content as

PUT : [http://localhost/typeahead/search/1](http://localhost/typeahead/search/1)

{  
"search" : {  
"input" : "us-en-us-chicago"  
}  
}

After indexing all the above data, verified the data using search. It  
returns the total "text" as indexed.  
When I ran the query for _suggest. (see below for the query and results)_.  
I am getting only 5 results out of it. Is this the expected behavior of  
completion suggester in ES? Or do i need to use different tool ?

Any suggestions are appreciated.

Suggest query:  
{  
"my-suggest" : {  
"text" : "us-en-us-chi",  
"completion" : {  
"field" : "search"  
}  
}  
}

and results as  
{  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
},  
"my-suggest": [  
{  
"text": "us-en-us-chi",  
"offset": 0,  
"length": 12,  
"options": [  
{  
"text": "us-en-us-chicago",  
"score": 1  
},  
{  
"text": "us-en-us-chicago, central loop",  
"score": 1  
},  
{  
"text": "us-en-us-chicago, east loop",  
"score": 1  
},  
{  
"text": "us-en-us-chicago, eastern east-west",  
"score": 1  
},  
{  
"text": "us-en-us-chicago, i-80 & i-55 corridors",  
"score": 1  
}  
]  
}  
]  
}

Kind Regards  
Madhavan.TR

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9a259863-c10e-43c2-91d7-699c48868f8e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9a259863-c10e-43c2-91d7-699c48868f8e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 4, 2014, 9:16am UTC](https://discuss.elastic.co/t/completion-suggestion-not-working-as-documented/19036/2 "2014-08-04T09:16:59Z")

</div>

hey,

you can configure the count of the retured elements using the "size"  
parameter, see

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

or the examples

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--Alex

On Fri, Aug 1, 2014 at 6:18 PM, Madhavan Ramachandran [madhavtr@gmail.com](mailto:madhavtr@gmail.com)  
wrote:

> Hi All,
> 
> I am new to Elastic Search. I try to implement the completion suggester as  
> documented in "[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/you-complete-me/)" with  
> sample data as below. Instead of hotel.. i choose region and locations..
> 
> us-en-us-chicago  
> us-en-us-chicago, central loop  
> us-en-us-chicago, east loop  
> us-en-us-chicago, eastern east-west  
> us-en-us-chicago, i-80 & i-55 corridors  
> us-en-us-chicago, i-90 corridor  
> us-en-us-chicago, north (cook county)  
> us-en-us-chicago, north (lake county)  
> us-en-us-chicago, north i-94 corridor  
> us-en-us-chicago, north michigan avenue  
> us-en-us-chicago, northwest  
> us-en-us-chicago, northwest indiana  
> us-en-us-chicago, o'hare  
> us-en-us-chicago, river north  
> us-en-us-chicago, west loop  
> us-en-us-chicago, western east-west
> 
> I am using POSTMAN, a chrome extension to create and query from Elastic  
> Search. I created Index using POSTMAN tool
> 
> PUT : [http://localhost/typeahead](http://localhost/typeahead)  
> {  
> "mappings": {  
> "search" : {  
> "properties" : {  
> "search" : {  
> "type" : "completion"  
> }  
> }  
> }  
> }  
> }
> 
> Indexed the above content as
> 
> PUT : [http://localhost/typeahead/search/1](http://localhost/typeahead/search/1)
> 
> {  
> "search" : {  
> "input" : "us-en-us-chicago"  
> }  
> }
> 
> After indexing all the above data, verified the data using search. It  
> returns the total "text" as indexed.  
> When I ran the query for _suggest. (see below for the query and results)_  
> .  
> I am getting only 5 results out of it. Is this the expected behavior of  
> completion suggester in ES? Or do i need to use different tool ?
> 
> Any suggestions are appreciated.
> 
> Suggest query:  
> {  
> "my-suggest" : {  
> "text" : "us-en-us-chi",  
> "completion" : {  
> "field" : "search"  
> }  
> }  
> }
> 
> and results as  
> {  
> "\_shards": {  
> "total": 5,  
> "successful": 5,  
> "failed": 0  
> },  
> "my-suggest": [  
> {  
> "text": "us-en-us-chi",  
> "offset": 0,  
> "length": 12,  
> "options": [  
> {  
> "text": "us-en-us-chicago",  
> "score": 1  
> },  
> {  
> "text": "us-en-us-chicago, central loop",  
> "score": 1  
> },  
> {  
> "text": "us-en-us-chicago, east loop",  
> "score": 1  
> },  
> {  
> "text": "us-en-us-chicago, eastern east-west",  
> "score": 1  
> },  
> {  
> "text": "us-en-us-chicago, i-80 & i-55 corridors",  
> "score": 1  
> }  
> ]  
> }  
> ]  
> }
> 
> Kind Regards  
> Madhavan.TR
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/9a259863-c10e-43c2-91d7-699c48868f8e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9a259863-c10e-43c2-91d7-699c48868f8e%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/9a259863-c10e-43c2-91d7-699c48868f8e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9a259863-c10e-43c2-91d7-699c48868f8e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM9hUm0bjJRm\_Mm21GPLxcAfqZGoW6%3DTGO8px0UKeN%2BM%2Bw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM9hUm0bjJRm_Mm21GPLxcAfqZGoW6%3DTGO8px0UKeN%2BM%2Bw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:11am UTC](https://discuss.elastic.co/t/completion-suggestion-not-working-as-documented/19036/3 "2017-07-06T01:11:06Z")

</div>


