es总结(四-1)单条数据增删改查

增加
 

PUT /my_index/my_type/2
{
	"content":"test 1",
	"tag":["haha"]
}

查询
 

GET /my_index/my_type/2

删除

DELETE /my_index/my_type/2

更新1:直接替换,需要传递所有的field才能实现部分field的更新操作

PUT /my_index/my_type/2
{
    "content":"test 2"
}

更新2:只需要传入相对应的field就能进行该filed 的修改(partial update)

Post /my_index/my_type/2/_update
{
    "doc":{
        "content":"test 2"
    }
}

 

转载于:https://my.oschina.net/u/3787570/blog/1803294

你可能感兴趣的:(es总结(四-1)单条数据增删改查)