您当前的位置: 首页 >  I.T10001

ES7.16.2基础操作-评分优化(九)

I.T10001 发布时间:2021-12-27 18:45:48 ,浏览量:4

## 搜索包含java,不包含spark(如果包含spark不会说不需要,而是降低评分)

GET customer/_search
{
  "query": {
    "boosting": {
      "positive": {
        "match": {
          "introduce": "Java"
        }
      },
      "negative": {
        "match": {
          "introduce": "spark"
        }
      },
      "negative_boost": 0.2
    }
  }
}

## 没有评分
GET customer/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "constant_score": {
            "filter": {
              "match": {
                "introduce": "java"
              }
            }
          }
        },
        {
          "constant_score": {
            "filter": {
              "match": {
                "introduce": "spark"
              }
            }
          }
        }
      ]
    }
  }
}

关注
打赏
1688896170
查看更多评论

I.T10001

暂无认证

  • 4浏览

    0关注

    154博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0879s