elasticsearch

时间:2016-09-20 21:13:46   收藏:0   阅读:160

curl ‘localhost:9200/_cat/health?v‘
curl ‘localhost:9200/_cat/nodes?v‘
curl ‘localhost:9200/_cat/indices?v‘

curl -XPUT ‘localhost:9200/customer?pretty‘
curl -XPUT ‘localhost:9200/customer/external/1?pretty‘ -d ‘
{
  "name": "John Doe"
}‘
curl -XGET ‘localhost:9200/customer/external/1?pretty‘
curl -XDELETE ‘localhost:9200/customer?pretty‘

curl -X<REST Verb> <Node>:<Port>/<Index>/<Type>/<ID>
//put 替换或新增
curl -XPUT ‘localhost:9200/customer/external/1?pretty‘ -d ‘
{
  "name": "John Doe"
}‘
/post _update 更新
curl -XPOST ‘localhost:9200/customer/external/1/_update?pretty‘ -d ‘
{
  "doc": { "name": "Jane Doe" }
}‘
curl -XPOST ‘localhost:9200/customer/external/1/_update?pretty‘ -d ‘
{
  "script" : "ctx._source.age += 5"
}‘

原文:http://www.cnblogs.com/anjuncc/p/5890362.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!