暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

elasticsearch 常用操作

会飞的锦鲤 2021-05-24
189

根据id删除数据

DELETE /testindex/workdto/123

{

 

}局部更新

POST /testindex/workdto/2/_update

{

 "doc": {

   "code": "1233345678"

 }

}新增

PUT /testindex/workdto/2

{

 "keyword": "G2",

 "class_text": "G2",

 "id": "2"

}根据id获取数据

GET /testindex/workdto/2

按字段查询

GET /testindex/workdto/_search

{

 "version":true,

 "query": {

   "term": {

     "id": {

       "value": "1"

     }

   }

 }

}in查询

GET /testindex/workdto/_search

{

 "from": 0,

 "size": 100,

 "query": {

   "bool": {

     "filter": [

       {

         "terms": {

           "Class.Code": [

             "G1025","G1024"

           ]

         }

       }

     ]

   }

 }

}

文章转载自会飞的锦鲤,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论