Return the tokens of a field


(Kennedy Idialu) #1

How can I have the tokens of a particular field returned in the result

For example, A GET request

curl -XGET 'http://localhost:9200/twitter/tweet/1'

returns

{"_index" : "twitter","_type" : "tweet","_id" : "1", "_source" : {
"user" : "kimchy",
"postDate" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"} }

I would like to have the tokens of '_source.message' field included in the
result

--


(Artem Grinblat) #2

You could feed the message to the Analyze APIhttp://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html
:
curl -XGET 'localhost:9200/twitter/_analyze?text=trying out Elastic Search'

--


(Artem Grinblat) #3

or better yet
curl -XGET 'localhost:9200/twitter/_analyze?field=tweet.message' -d 'trying
out Elastic Search'

--


(system) #4