您的位置 首页 elasticsearch

es 文档批量操作api

文档的批量操作:
- 增
POST
http://10.0.0.111:19200/_bulk
{ "create":{"_index":"baimei","_id":1001}}
{"name":"郭言金","hobby":["小皮鞭","小蜡烛","高跟鞋"]}
{ "create":{"_index":"baimei","_id":1002}}
{"name":"杜天泽","hobby":["郭言金","丝袜","抽烟","喝酒","烫头"]}
{ "create":{"_index":"baimei"}}
{"name":"赵师","hobby":["妹子","吃王八"]}

 

 

- 查
GET

http://10.0.0.111:19200/_mget

 

{
  "docs": [
    {
      "_index": "baimei",
      "_id": "1001"
    },
    {
      "_index": "baimei",
      "_id": "1002"
    }
  ]
} 

 

- 改
POST

http://10.0.0.111:19200/_bulk

 

{ "update" : {"_id" : "1001", "_index" : "baimei"} }
{ "doc" : {"name" : "GuoYanJin"} }
{ "update" : {"_id" : "1002", "_index" : "baimei"} }
{ "doc" : {"name" : "DuTianZe"} }

 

 

- 删
POST
http://10.0.0.111:19200/_bulk
{ "delete" : { "_index" : "baimei", "_id" : "1001" } }
{ "delete" : { "_index" : "baimei", "_id" : "1002" } }

 

 

 

 

 

 

 

欢迎来撩 : 汇总all

白眉大叔

关于白眉大叔linux云计算: 白眉大叔

热门文章