1、Curl
- 类似于HTTP请求
- -X 指定http的请求方法 有HEAD GET POST PUT DELETE
- -d 指定要传输的数据
- -H 指定http请求头信息
往es中创建一个索引库blog01
curl -XPUT http://node-01:9200/blog01/?pretty
插入一条数据
curl -XPUT http://node-01:9200/blog01/article/1?pretty -d '{"id": "1", "title": "What is lucene"}'
curl -XPUT http://node-01:9200/blog01/article/1?pretty -d '{"id": "1", "title": "What is lucene"}' -H "Content-Type: application/json"
{
"_index" : "blog01", --指定是索引库名称
"_type" : "article", --指定是type的名称
"_id" : "1", --这是document_id
"_version" : 1, --这条数据的版本
"result" : "created", --结果状态
"_shards" : {
--操作的分片的信息
"total" : 2