Friday, March 27, 2015

elasticsearch create index and add documents

1, Create Index
curl -XPUT 'http://localhost:9200/twitter/'

2, add docs:
 curl -XPUT 'http://localhost:9200/twitter/tweet/22' -d '{
    "user" : "kimchy22",
    "post_date" : "2015-03-27T12:12:12",
    "message" : "trying out Elasticsearch"
}'
  
 curl -XPUT 'http://localhost:9200/twitter/tweet/21' -d '{
    "user" : "kimchy21",
    "post_date" : "2015-03-27T11:12:12",
    "message" : "trying out Elasticsearch"
}'

No comments:

Post a Comment