ES学习(二)--增删改查
一、 查看健康状况
GET _cat/health?v
二、 查看索引
GET _cat/indices?v
三、 插入索引
PUT /ecommerce
四、 在索引下插入文档
PUT /ecommerce/_doc/1
{
"name":"gaolujie yagao",
"desc":"youxiao fangzhu",
"price":25,
"producer":"gaolujie producer",
"tags":["meibai","fangzhu"]
}
五、获取文档
GET /ecommerce/_doc/1
六、修改文档
A、方式一 替换
PUT /ecommerce/_doc/1
{
"name":"jiaqiangban gaolujie yaogao",
"desc":"gaoxiao meibai",
"price":25,
"producer":"jiajieshi producer",
"tags":["meibai","fangzhu"]
}
B、 方式二 修改
POST /ecommerce/_update/1
{
"doc": {
"name":"changed"
}
}