如何使用jest在弹性搜索中使用where条件更新多个文档

时间:2018-06-04 13:04:32

标签: jest elasticsearch-5

在弹性搜索5.6中考虑以下文档

    "_index" : "comp",
    "_type" : "employee",
    "_id" : "1",
    "_score" : 1.0,
    "_source" : {
        "name":"tanmay",
        "eid":"e01",
        "address":"ram bagh",
        "salary":"2000",
        "rating":"5"
    }

    "_index" : "comp",
    "_type" : "employee",
    "_id" : "2",
    "_score" : 1.0,
    "_source" : {
        "name":"tanmay",
        "eid":"e01",
        "address":"ram bagh",
        "salary":"1000",
        "rating":"3"
    }

    "_index" : "comp",
    "_type" : "employee",
    "_id" : "3",
    "_score" : 1.0,
    "_source" : {
        "name":"tanmay",
        "eid":"e03",
        "address":"ram bagh",
        "salary":"500",
        "rating":"1"
    }

Index = comp和type = employee

在这里,我想将所有员工的工资更新为5000,其中评级> 2

如何使用JEST API在弹性搜索中执行此操作

在RDBMS中,我们可以使用此查询“update employee set salary = 5000 where rating> 2”

那么什么是弹性搜索JEST API的等效查询

0 个答案:

没有答案