Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BoostingCondition

根据postive和negative来提升或降低部分文档的得分,返回与postive查询匹配的文档。

example

import * as es from 'es' ```ts
let client=es.newClient('axis_esClient')
let boost: es.BoostingCondition = {
  "positive": {
     "term": {
           "text": "apple"
      }
  },
  "negative": {
      "term": {
          "text": "pie tart fruit crumble tree"
      }
  },
  "negative_boost": 0.5
}
let querydsl:es.Query={
    "boosting":boost
}
let cnt = client.updateByQuery("indexName", querydsl, "newScript")

Hierarchy

  • BoostingCondition

Index

Properties

Optional boost

boost: number

boost: 浮点数,用作与筛选器查询匹配的每个文档的常量相关性分数。

negative

negative: Query

negative: 用于降低匹配文档的相关性得分的查询。

negative_boost

negative_boost: number

negative_boost:0到1.0之间的浮点数,用于降低与查询匹配的文档的相关性分数。

positive

positive: Query

positive:希望运行的查询。任何返回的文档都必须与此查询匹配。