ElasticSearch Suggest returning blank, i.e no options

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.
For more options, visit https://groups.google.com/groups/opt_out.

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.
For more options, visit https://groups.google.com/groups/opt_out.