es1

增:
多个:
post _bulk
{"create":{"_index":"索引","_id":"id"}}
{"id":1,"title":"小米手机","price":3999}
{"create":{"_index":"索引","_id":"id"}}

单个:
put /索引/_doc/id
{
"key":"value"
}


查:
所有:
post /索引/_search
{
"query":{
"match_all":{}
}
}

带条件:
post /索引/_search
{
"query":
{
"match":
{
"字段":"value"
}
}
}

单个:
get /索引/_doc/id


改:
全局改的话跟新增操作一样会直接覆盖;
局部改:
post /索引/_update/id
{
"doc":{
"key":"value"
}
}

删(可多个删除):
delete _bulk
{"delete":{"_index":"索引","_id":"id"}}

按指定查询条件删除:
post /my_test/_delete_by_query
{
"query":{
"match":{
"filed":"value"
}
}
}

posted @ 2023-05-24 01:24  mty072788  阅读(3)  评论(0编辑  收藏  举报