elastic 6.x 利用restApi 与集群进行交互 .3.2

1.修改数据

PUT /customer/_doc/1?pretty
{
  "name": "John Doe"

}

PUT /customer/_doc/1?pretty

{
  "name": "Jane Doe"
}

PUT /customer/_doc/2?pretty

{
  "name": "Jane Doe"
}

POST /customer/_doc?pretty

{
  "name": "Jane Doe"
}                           

2.更新文档

POST /customer/_doc/1/_update?pretty
{
  "doc": { "name": "Jane Doe" }

}

POST /customer/_doc/1/_update?pretty

{
  "doc": { "name": "Jane Doe", "age": 20 }
}

POST /customer/_doc/1/_update?pretty

 
 
{
  "script" : "ctx._source.age += 5"
}

3.删除文档.

DELETE /customer/_doc/2?pretty


猜你喜欢

转载自blog.csdn.net/weixin_38098312/article/details/80075899