美文网首页
ES 更新操作

ES 更新操作

作者: 小家猫 | 来源:发表于2020-02-14 14:26 被阅读0次

    http://localhost:9200/{index}/{type}/_update_by_query

    {
      "query": {
        "bool": {
          "must_not": {
            "exists": {
              "field": "combination"
            }
          }
        }
      },
      "script": {
        "inline": "ctx._source['combination'] = false"
      }
    }
    
    POST /{index}/_update_by_query
    {
     "query": {
      "bool": {
       "must": [{
         "term": {
          "institutionId": 239
         }
        },
        {
         "term": {
          "deleted": false
         }
        },
        {
         "terms": {
          "category": [8, 9]
         }
        }
       ]
      }
     },
     "script": {
      "source": "ctx._source['isOutsideHospital'] = true;ctx._source['outsideCompany'] = 'xxx'"
     }
    }
    
    POST /customer/_doc/1/_update?pretty
    {
      "doc": { "name": "Jane Doe", "age": 20 }
    }
    

    相关文章

      网友评论

          本文标题:ES 更新操作

          本文链接:https://www.haomeiwen.com/subject/abwdfhtx.html