Count the term from an specific field


(Sumit Guptaa) #1

Hi all,
i m very new in elasticsearch....pl help me...

we have created index name "my_twitter2" and we want to search word "abc"from "message" : "abc xyz abc xyz asdsad fdfdf abc xyz abc" field and also we want to count the number of "abc" how much time appear and also count all the word that contain message filed...
can anybody give the query for this..

curl -XPUT 'http://localhost:9200/my_twitter2/
curl -XPUT 'http://localhost:9200/my_twitter2/my_tweet2/1' -d '{
"_id" : 1,
"user" : "hi hello hi hello whyyyy whennn hi hello hi",
"post_date" : "2009-11-23T14:12:12",
"message" : "abc xyz abc xyz asdsad fdfdf abc xyz abc"
}'

thanx in advance...

Regards,
Sumit Gupta


(system) #2