# ElasticSearch Suggest returning blank, i.e no options

**URL:** <https://discuss.elastic.co/t/elasticsearch-suggest-returning-blank-i-e-no-options/12144>\
**Category:** Elasticsearch\
**Created:** [May 28, 2013, 9:16am UTC](https://discuss.elastic.co/t/elasticsearch-suggest-returning-blank-i-e-no-options/12144 "2013-05-28T09:16:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abraham\_Alaka](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@Abraham\_Alaka](https://discuss.elastic.co/u/Abraham_Alaka)\
**Post date:** [May 28, 2013, 9:16am UTC](https://discuss.elastic.co/t/elasticsearch-suggest-returning-blank-i-e-no-options/12144/1 "2013-05-28T09:16:46Z")

</div>

Running: curl -XPOST 'localhost:9200/\_suggest' -d '{"my-suggestion" :  
{"text" : "guc", "term" : {"field" : "name"}}}'

Gives: {"\_shards":{"total":20,"successful":20,"failed":0},"my-suggestion":[{"text":"guc","offset":0,"length":3,"options":[]}]}

ES version is: curl -XGET 'localhost:9200'{  
"ok" : true,  
"status" : 200,  
"name" : "Brother Tode",  
"version" : {  
"number" : "0.90.0",  
"snapshot\_build" : false  
},

Anyone have a start to end example of suggest working? The docs are a bit  
sparse.

Settings are here:

INDEX\_SETTINGS = {  
'index' : {  
'analysis' : {  
'analyzer' : {  
'edge\_ngram\_analyzer' : {  
'tokenizer' : 'left\_tokenizer',  
'filter' : ['standard', 'lowercase', 'stop'],  
'type' : 'custom'  
}  
},  
'tokenizer': {  
'left\_tokenizer' : {  
'side' : 'front',  
'max\_gram' : 20,  
'type' : 'edgeNGram'  
},  
'right\_tokenizer' : {  
'side' : 'back',  
'max\_gram' : 20,  
'type' : 'edgeNGram'  
}  
},  
'filter' : {  
'filter\_ngram' : {  
'type' : 'edgeNGram',  
'side' : 'front',  
'max\_gram' : 30,  
'min\_gram' : 2  
}  
}  
}  
}  
}

MAPPING = {  
'name' : {'type': 'string', 'index' : 'not\_analyzed', 'boost' : 2},  
's\_name' : {'type': 'string', 'analyzer' : 'edge\_ngram\_analyzer',  
'boost' : 2},  
'site\_id': { 'type' : 'string', 'boost' : -1 },  
'original\_category': { 'type' : 'string', 'boost' : 1, 'index' :  
'not\_analyzed' },  
's\_original\_category': { 'type' : 'string', 'boost' : 1, 'index' :  
'analyzed' },  
'description': { 'type' : 'string', 'boost' : 1 },  
'color': { 'type' : 'string', 'boost' : 5, 'index' : 'not\_analyzed'},  
's\_color': { 'type' : 'string', 'boost' : 5, 'index' : 'analyzed'},  
'color\_idx': { 'type' : 'string', 'index' : 'not\_analyzed',  
'include\_in\_all' : False },  
'available\_sizes': { 'include\_in\_all' : False, 'type': 'string' },  
'unavailable\_sizes': { 'include\_in\_all' : False, 'type': 'string' },  
'available\_sizes\_idx': { 'type' : 'string', 'index' : 'not\_analyzed' },  
'unavailable\_sizes\_idx': { 'type' : 'string', 'index' : 'not\_analyzed'  
},  
'designer': { 'type' : 'string', 'index' : 'not\_analyzed' },  
's\_designer': { 'type' : 'string', 'index' : 'analyzed' },  
'shop\_name': { 'type' : 'string', 'index' : 'not\_analyzed' },  
's\_shop\_name': { 'type' : 'string', 'index' : 'analyzed' },  
'friendly\_url': { 'type' : 'string', 'index' : 'not\_analyzed' },  
# other fields can be added on demand if default mapping is not  
sufficient  
}

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Abraham\_Alaka](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@Abraham\_Alaka](https://discuss.elastic.co/u/Abraham_Alaka)\
**Post date:** [May 31, 2013, 4:02pm UTC](https://discuss.elastic.co/t/elasticsearch-suggest-returning-blank-i-e-no-options/12144/2 "2013-05-31T16:02:23Z")

</div>

Does anyone still use this group:

A bit more detail here. Basically what I need to know is if there is a  
standard setup (analyzer, tokenizer, etc) that gives autosuggest as opposed  
to the blank options I am currently getting.

Thanks.

On Tuesday, 28 May 2013 10:16:46 UTC+1, Abraham Alaka wrote:

> Running: curl -XPOST 'localhost:9200/\_suggest' -d '{"my-suggestion" :  
> {"text" : "guc", "term" : {"field" : "name"}}}'
> 
> Gives: {"\_shards":{"total":20,"successful":20,"failed":0},"my-suggestion":[{"text":"guc","offset":0,"length":3,"options":}]}
> 
> ES version is: curl -XGET 'localhost:9200'{  
> "ok" : true,  
> "status" : 200,  
> "name" : "Brother Tode",  
> "version" : {  
> "number" : "0.90.0",  
> "snapshot\_build" : false  
> },
> 
> Anyone have a start to end example of suggest working? The docs are a bit  
> sparse.
> 
> Settings are here:
> 
> INDEX\_SETTINGS = {  
> 'index' : {  
> 'analysis' : {  
> 'analyzer' : {  
> 'edge\_ngram\_analyzer' : {  
> 'tokenizer' : 'left\_tokenizer',  
> 'filter' : ['standard', 'lowercase', 'stop'],  
> 'type' : 'custom'  
> }  
> },  
> 'tokenizer': {  
> 'left\_tokenizer' : {  
> 'side' : 'front',  
> 'max\_gram' : 20,  
> 'type' : 'edgeNGram'  
> },  
> 'right\_tokenizer' : {  
> 'side' : 'back',  
> 'max\_gram' : 20,  
> 'type' : 'edgeNGram'  
> }  
> },  
> 'filter' : {  
> 'filter\_ngram' : {  
> 'type' : 'edgeNGram',  
> 'side' : 'front',  
> 'max\_gram' : 30,  
> 'min\_gram' : 2  
> }  
> }  
> }  
> }  
> }
> 
> MAPPING = {  
> 'name' : {'type': 'string', 'index' : 'not\_analyzed', 'boost' : 2},  
> 's\_name' : {'type': 'string', 'analyzer' : 'edge\_ngram\_analyzer',  
> 'boost' : 2},  
> 'site\_id': { 'type' : 'string', 'boost' : -1 },  
> 'original\_category': { 'type' : 'string', 'boost' : 1, 'index' :  
> 'not\_analyzed' },  
> 's\_original\_category': { 'type' : 'string', 'boost' : 1, 'index' :  
> 'analyzed' },  
> 'description': { 'type' : 'string', 'boost' : 1 },  
> 'color': { 'type' : 'string', 'boost' : 5, 'index' : 'not\_analyzed'},  
> 's\_color': { 'type' : 'string', 'boost' : 5, 'index' : 'analyzed'},  
> 'color\_idx': { 'type' : 'string', 'index' : 'not\_analyzed',  
> 'include\_in\_all' : False },  
> 'available\_sizes': { 'include\_in\_all' : False, 'type': 'string' },  
> 'unavailable\_sizes': { 'include\_in\_all' : False, 'type': 'string' },  
> 'available\_sizes\_idx': { 'type' : 'string', 'index' : 'not\_analyzed' },  
> 'unavailable\_sizes\_idx': { 'type' : 'string', 'index' :  
> 'not\_analyzed' },  
> 'designer': { 'type' : 'string', 'index' : 'not\_analyzed' },  
> 's\_designer': { 'type' : 'string', 'index' : 'analyzed' },  
> 'shop\_name': { 'type' : 'string', 'index' : 'not\_analyzed' },  
> 's\_shop\_name': { 'type' : 'string', 'index' : 'analyzed' },  
> 'friendly\_url': { 'type' : 'string', 'index' : 'not\_analyzed' },  
> # other fields can be added on demand if default mapping is not  
> sufficient  
> }

--  
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).  
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, 2:33am UTC](https://discuss.elastic.co/t/elasticsearch-suggest-returning-blank-i-e-no-options/12144/3 "2017-07-06T02:33:34Z")

</div>


