Curl操作Elasticsearch的常用方法
Elasticsearch对于文档操作,提供了以下几种API,本文就说明如何使用curl方式来调用这些API。 API种类 单文档操作API 1、* Index API 索引文档 * 为文档创建索引 curl -XPUT "http://localhost:9200/twitter/tweet/1"; -H 'Content-Type: application/json' -d' { "user" : "kimchy", "post_date" : "2009-11-15T14:12:12", "message" : "trying out Elasticsearch" }' 返回结果 { "_shards" : { "total" : 2, #表示应该在多少个节点执行操作 "failed" : 0, #表示失败的个数 "successful" : 2 #表示成功的个数,正常情况最小应该是1 }, "_index" : "twitter", "_type" : "tweet", "_id" : "1", "_version" : 1, "created" : true, "result...