您的位置 首页 elasticsearch

es 文档操作api

es 文档操作api

文档操作-创建文档

01.不指定文档id创建
POST http://10.0.0.101:19200/baimeidashu-linux86/_doc、
http://10.0.0.111:19200/baimei/_doc
{"name":"王彬彬","hobby":["大","长","腿"]}

02-指定文档id创建
POST
http://10.0.0.111:19200/baimei/_doc/1001
{"name":"王石头","hobby":["白","副","美"]}

文档操作-查看文档
1.全量查询
GET
http://10.0.0.111:19200/baimei/_search

 

2.查询指定的文档
GET
http://10.0.0.111:19200/baimei/_doc/1001

文档操作-修改文档

1.全量更新
POST
http://10.0.0.111:19200/baimei/_doc/1001/
{
    "name": "王硕",
    "hobby": [
        "丝",
        "白",
        "韩"
    ]
}

 

2.局部更新
POST
http://10.0.0.111:19200/baimei/_doc/1001/_update

 

{
   "doc":{
       "hobby":["扭秧歌","广场舞","抽烟"],
       "address": "301"
   }
}

 

文档操作-删除操作
DELETE
http://10.0.0.111:19200/baimei/_doc/1001

 

欢迎来撩 : 汇总all

白眉大叔

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

热门文章