# Bug with suggest feature when you have a source field at the root of your mapping

**URL:** <https://discuss.elastic.co/t/bug-with-suggest-feature-when-you-have-a-source-field-at-the-root-of-your-mapping/15911>\
**Category:** Elasticsearch\
**Created:** [February 19, 2014, 10:40pm UTC](https://discuss.elastic.co/t/bug-with-suggest-feature-when-you-have-a-source-field-at-the-root-of-your-mapping/15911 "2014-02-19T22:40:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loic\_Bertron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loic_bertron/32/1794_2.png) [@Loic\_Bertron](https://discuss.elastic.co/u/Loic_Bertron)\
**Post date:** [February 19, 2014, 10:40pm UTC](https://discuss.elastic.co/t/bug-with-suggest-feature-when-you-have-a-source-field-at-the-root-of-your-mapping/15911/1 "2014-02-19T22:40:20Z")

</div>

Hello guys,

I was trying to play with the suggest feature and get a headache when my  
first basic example was working but my complexe one wasn't giving results  
at all.  
I just figured out that when you have a source field at the higher level of  
your mapping/document, the suggest feature doesn't return anything.

Here is my mapping which the suggest feature doesn't work :

{  
"source" : {  
"properties" : {  
"domain" : {  
"type" : "completion",  
"analyzer" : "autocomplete",  
"payloads" : true,  
"preserve\_separators" : false,  
"preserve\_position\_increments" : false,  
"max\_input\_len" : 50  
},  
"forum" : {  
"type" : "completion",  
"analyzer" : "autocomplete",  
"payloads" : true,  
"preserve\_separators" : false,  
"preserve\_position\_increments" : false,  
"max\_input\_len" : 50  
},  
"source" : {  
"properties" : {  
"name" : {  
"type" : "completion",  
"analyzer" : "autocomplete",  
"payloads" : true,  
"preserve\_separators" : false,  
"preserve\_position\_increments" : false,  
"max\_input\_len" : 50  
}  
}  
}  
}  
}  
}

Here is my new working one. I just replaced source by toto.

{  
"source" : {  
"properties" : {  
"domain" : {  
"type" : "completion",  
"analyzer" : "autocomplete",  
"payloads" : true,  
"preserve\_separators" : false,  
"preserve\_position\_increments" : false,  
"max\_input\_len" : 50  
},  
"forum" : {  
"type" : "completion",  
"analyzer" : "autocomplete",  
"payloads" : true,  
"preserve\_separators" : false,  
"preserve\_position\_increments" : false,  
"max\_input\_len" : 50  
},  
"toto" : {  
"properties" : {  
"name" : {  
"type" : "completion",  
"analyzer" : "autocomplete",  
"payloads" : true,  
"preserve\_separators" : false,  
"preserve\_position\_increments" : false,  
"max\_input\_len" : 50  
}  
}  
}  
}  
}  
}

I've just created a new issue here  
: [https://github.com/elasticsearch/elasticsearch/issues/5182?source=cc](https://github.com/elasticsearch/elasticsearch/issues/5182?source=cc)

Thanks

--  
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/07481175-993f-4395-afd8-1409f742f754%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/07481175-993f-4395-afd8-1409f742f754%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:48am UTC](https://discuss.elastic.co/t/bug-with-suggest-feature-when-you-have-a-source-field-at-the-root-of-your-mapping/15911/2 "2017-07-06T01:48:58Z")

</div>


