Term suggester example?

I am trying to get term suggest to work and it may be that it's not going
to work the way I think it should, but I can't seem to get it to work at
all
. So I put together an example index to illustrate the point,
hopefully someone can point out what I'm doing wrong.

Basically, I want to be able to get suggestions for documents based on
terms. For instance, if I have documents with a name of "North America"
and "South America", I would like a _suggest of "america" to return
suggestions for both of those documents. Note that I'm moving away from
completion suggest because they are documented and appear to work only as
prefix suggestors.

Here is my not-working example, appreciate any pointers!

#!/bin/sh

ES=localhost:9200

echo ">>> Deleting _all"
curl -XDELETE $ES/_all

CONTINENTS=("North America" "South America" "Europe" "Asia" "Australia")
for ((i = 0; i < ${#CONTINENTS[@]}; i++))
do
c=${CONTINENTS[$i]}
echo ">>> Indexing the '$c' document"
curl -XPOST $ES/continents/continent -d'
{
"name": "$c"
}
' && echo
echo "${CONTINENTS[$i]}"
done

curl -XPOST $ES/continents/_flush && echo

Search for the document using the name

echo
echo ">>> Getting _suggest for 'america'"
echo
curl $ES/continents/_suggest -d'
{
"my-suggestion" : {
"text" : "america",
"term" : {
"field" : "name",
"suggest_mode" : "always"
}
}
}' && echo

Here's the output I'm currently getting:

Getting _suggest for 'america'

{"_shards":{"total":5,"successful":5,"failed":0},"my-suggestion":[{"text":
"america","offset":0,"length":7,"options":[]}]}

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/56349847-7ee6-4d06-9b26-d624878a311a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.