Mapping for suggester


#1

For term or phrase suggesters do I need to have appropriate mapping in place or would they work on a string field ? I tried this query on twitter example index and it created a document with id _suggest. I had a user with title max which I was expecting to come. What am I doing wrong ?

curl -X POST 'localhost:9200/twitter/tweet/_suggest?pretty' -d '{
"user-suggest" : {
"text" : "mix",
"phrase" : {
"field" : "user"
}
}
}'
{
"_index" : "twitter",
"_type" : "tweet",
"_id" : "_suggest",
"_version" : 5,
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"created" : false
}


(system) #2