public class BoostingQueryBuilder extends QueryBuilder implements BoostableQueryBuilder<BoostingQueryBuilder>
Query balancedQuery = new BoostingQuery(positiveQuery, negativeQuery, 0.01f); In this scenario the positiveQuery contains the mandatory, desirable criteria which is used to select all matching documents, and the negativeQuery contains the undesirable elements which are simply used to lessen the scores. Documents that match the negativeQuery have their score multiplied by the supplied "boost" parameter, so this should be less than 1 to achieve a demoting effect
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsEMPTY_PARAMS| コンストラクタと説明 |
|---|
BoostingQueryBuilder() |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
BoostingQueryBuilder |
boost(float boost)
Sets the boost for this query.
|
protected void |
doXContent(XContentBuilder builder,
ToXContent.Params params) |
BoostingQueryBuilder |
negative(QueryBuilder negativeQuery) |
BoostingQueryBuilder |
negativeBoost(float negativeBoost) |
BoostingQueryBuilder |
positive(QueryBuilder positiveQuery) |
toXContentbuildAsBytes, buildAsBytes, toStringpublic BoostingQueryBuilder positive(QueryBuilder positiveQuery)
public BoostingQueryBuilder negative(QueryBuilder negativeQuery)
public BoostingQueryBuilder negativeBoost(float negativeBoost)
public BoostingQueryBuilder boost(float boost)
BoostableQueryBuilderboost インタフェース内 BoostableQueryBuilder<BoostingQueryBuilder>protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
doXContent クラス内 QueryBuilderIOExceptionCopyright © 2009–2016. All rights reserved.