elasticsearch(2)简单的CRUD操作

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sz85850597/article/details/82561870

create

PUT /index/type/id
{
    "key":"value"
}

例如:

PUT /ecommerce/product/1
{
    "name":"高露洁牙膏",
    "desc":"高效美白",
    "price":30,
    "tags":["美白","防蛀"]
}

delete

DELETE /index/type/id

例如:

DELETE /ecommerce/product/1

update

POST /index/type/id/_update
{
  "doc": {
    "key":"value"
  }
}

例如:

POST /ecommerce/product/1/_update
{
  "doc": {
    "name":"佳洁士牙膏"
  }
}

read

GET /index/type/id

例如:

GET /ecommerce/product/1

猜你喜欢

转载自blog.csdn.net/sz85850597/article/details/82561870