elasticsearch boost importance of exact phrase match

前端 未结 5 941
无人共我
无人共我 2020-12-25 15:12

Is there a way in elasticsearch to boost the importance of the exact phrase appearing in the the document?

For example if I was searching for the phrase \"web develo

5条回答
  •  星月不相逢
    2020-12-25 15:32

    I used below sample query in my case which is working. It brings exact + fuzzy results but exact ones are boosted!

    { "query": {
    "bool": {
      "should": [
        {
          "match": {
            "name": "pala"
          }
        },
        {
          "fuzzy": {
            "name": "pala"
          }
        }
      ]
    }}}
    

提交回复
热议问题