# Completion suggester troubles

**URL:** <https://discuss.elastic.co/t/completion-suggester-troubles/21105>\
**Category:** Elasticsearch\
**Created:** [December 5, 2014, 2:42pm UTC](https://discuss.elastic.co/t/completion-suggester-troubles/21105 "2014-12-05T14:42:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Irwin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_irwin/32/985_2.png) [@Michael\_Irwin](https://discuss.elastic.co/u/Michael_Irwin)\
**Post date:** [December 5, 2014, 2:42pm UTC](https://discuss.elastic.co/t/completion-suggester-troubles/21105/1 "2014-12-05T14:42:46Z")

</div>

I'm using the Completion suggester with v1.4.1, and I'm noticing an  
issue regarding case sensitivity. For example, I have this mapping:

{  
"mappings": {  
"artist": {  
"properties": {  
"suggest": {  
"type": "completion",  
"payloads": true  
},  
"name": {  
"type": "string"  
}  
}  
}  
}  
}

I add a document with artist.name = "foo bar" and add another document but with the name in ALL CAPS (e.g. "FOO BAR"). I do a completion query for "foo", I get back two separate completions, one for each different case. How can I ensure only one completion is returned regardless of case?

## Thanks!

Mike

--  
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/20141205144245.GA11737%40bonzo](https://groups.google.com/d/msgid/elasticsearch/20141205144245.GA11737%40bonzo).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![micpalmia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/micpalmia/32/541_2.png) [@micpalmia](https://discuss.elastic.co/u/micpalmia)\
**Post date:** [December 5, 2014, 5:01pm UTC](https://discuss.elastic.co/t/completion-suggester-troubles/21105/2 "2014-12-05T17:01:00Z")

</div>

The only way to have results deduplicated seems to be using the same output for  
the same entry.

From the manual  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html#indexing](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html#indexing)  
:  
output - The string to return, if a suggestion matches. This is very useful  
to normalize outputs (i.e. have them always in the format artist -  
songname). This is optional. Note: _The result is de-duplicated if several  
documents have the same output_, i.e. only one is returned as part of the  
suggest result.

Michele

On Friday, 5 December 2014 15:42:54 UTC+1, Michael Irwin wrote:

> I'm using the Completion suggester with v1.4.1, and I'm noticing an  
> issue regarding case sensitivity. For example, I have this mapping:
> 
> {  
> "mappings": {  
> "artist": {  
> "properties": {  
> "suggest": {  
> "type": "completion",  
> "payloads": true  
> },  
> "name": {  
> "type": "string"  
> }  
> }  
> }  
> }  
> }
> 
> I add a document with artist.name = "foo bar" and add another document  
> but with the name in ALL CAPS (e.g. "FOO BAR"). I do a completion query for  
> "foo", I get back two separate completions, one for each different case.  
> How can I ensure only one completion is returned regardless of case?
> 
> ## Thanks!
> 
> Mike

--  
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/e9d5292f-d948-4b9b-a0dd-a92aa804150e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e9d5292f-d948-4b9b-a0dd-a92aa804150e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Michael\_Irwin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_irwin/32/985_2.png) [@Michael\_Irwin](https://discuss.elastic.co/u/Michael_Irwin)\
**Post date:** [December 5, 2014, 10:38pm UTC](https://discuss.elastic.co/t/completion-suggester-troubles/21105/3 "2014-12-05T22:38:52Z")

</div>

Thanks. I've tried ensuring the outputs are identicial (making them all  
lowercase), but I'm still seeing duplicates. Any other ideas?

On Friday, December 5, 2014 12:01:00 PM UTC-5, Michele Palmia wrote:

> The only way to have results deduplicated seems to be using the same output  
> for the same entry.
> 
> From the manual  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html#indexing](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html#indexing)  
> :  
> output - The string to return, if a suggestion matches. This is very  
> useful to normalize outputs (i.e. have them always in the format artist -  
> songname). This is optional. Note: _The result is de-duplicated if  
> several documents have the same output_, i.e. only one is returned as  
> part of the suggest result.
> 
> Michele
> 
> On Friday, 5 December 2014 15:42:54 UTC+1, Michael Irwin wrote:
> 
> > I'm using the Completion suggester with v1.4.1, and I'm noticing an  
> > issue regarding case sensitivity. For example, I have this mapping:
> > 
> > {  
> > "mappings": {  
> > "artist": {  
> > "properties": {  
> > "suggest": {  
> > "type": "completion",  
> > "payloads": true  
> > },  
> > "name": {  
> > "type": "string"  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > I add a document with artist.name = "foo bar" and add another document  
> > but with the name in ALL CAPS (e.g. "FOO BAR"). I do a completion query for  
> > "foo", I get back two separate completions, one for each different case.  
> > How can I ensure only one completion is returned regardless of case?
> > 
> > ## Thanks!
> > 
> > Mike

--  
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/424aae64-eb03-4913-ba0f-f82e6fdcb795%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/424aae64-eb03-4913-ba0f-f82e6fdcb795%40googlegroups.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, 12:45am UTC](https://discuss.elastic.co/t/completion-suggester-troubles/21105/4 "2017-07-06T00:45:24Z")

</div>


