elasticsearch,Boost,elasticsearch" /> elasticsearch,Boost,elasticsearch" />

Boost elasticsearch如何根据特定值进行增压

Boost elasticsearch如何根据特定值进行增压,boost,elasticsearch,Boost,elasticsearch,这是我的索引 PUT /testtest/ { "mappings" : { "docs" : { "properties" : { "field1" : { "type" : "string" },"field2" : { "type" : "string" } } } } } 我想为field1搜索一个特定的值,然后如果field2的值等于一个特定的单词(

这是我的索引

PUT /testtest/
{
  "mappings" : {
    "docs" : {
      "properties" : {
        "field1" : {
          "type" : "string"
        },"field2" : {
          "type" : "string"
        }
      }
    }
  }
}
我想为
field1
搜索一个特定的值,然后如果
field2
的值等于一个特定的单词(例如“游泳”),我想比其他单词更有效地提升它

我试过的 但是我得到了查询的解析错误,我现在不知道我所做的是否正确

 GET /bla bla/_search
{
  "query": {
      "match": {
        "field1": "value to search goes here"
      }, 
    "boosting": {
      "positive": {
        "term": {
          "field2": {
            "value": "values to positive boost goes here"
          }
        }
      },
      "negative": {
        "term": {
          "field2": {
            "value": "value to negative boost goes here"
          }
        }
      },
      "negative_boost": 0.5
    }
  }
}