创建索引
curl -XPUT 'http://localhost:9200/blogs' -d ' { "settings": { "number_of_shards": 3, "number_of_replicas": 1 }, "mappings": { } }
添加数据(一)
curl -XPUT 'http://localhost:9200/blogs/_doc/{_id}' -d ' { "title":"This is a article about Docker", "category":"Docker Info", }
修改数据(一)
curl -XPOST ' localhost:9200/blogs/user/1/_update' -d ' { "doc":{ "category":"Docker anyone" } }
修改数据(二)
curl 'http://127.0.0.1:9200/blogs/_doc/1/_update' -d ' { "script":{ "lang":"painless", "inline":"ctx._source.hit += 10" } }'
修改数据(三)
curl 'http://127.0.0.1:9200/blogs/_doc/1/_update' -d ' { "script":{ "lang":"painless", "inline":"ctx._source.hits = params.hits", "params":{ "hits":100 } } }'