Elasticsearch语句整理

并且或

index/_search
{
 "query": {
    "bool": {
       "must": [
         {
           "term": {
             "storeId": {
               "value": 2
             }
           }
         }
       ], 
      "should": [
        {
          "match": {
          "title": "答题技巧"
        }
        },{
          "match": {
            "title": "常见问题解答"
          }
        }
      ]
    }
  }
}

//更新一条数据

POST /index/_update_by_query
{
"query": {
"term": {
"_id": "b43d71d7ed6740ff9615885bae5f9e64"
}
},
"script": {
"lang": "painless",
"source": "ctx._source.id = params.id",
"params": {
"id": "b43d71d7ed6740ff9615885bae5f9e64"
}
}
}

 

posted @ 2021-03-10 15:24  卡玛兹  阅读(76)  评论(0编辑  收藏  举报
你好