diff --git a/src/main/java/org/elasticsearch/index/query/CustomFiltersScoreQueryBuilder.java b/src/main/java/org/elasticsearch/index/query/CustomFiltersScoreQueryBuilder.java index 4ec6da661ab..c82536c7dc4 100644 --- a/src/main/java/org/elasticsearch/index/query/CustomFiltersScoreQueryBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/CustomFiltersScoreQueryBuilder.java @@ -29,8 +29,6 @@ import java.util.Map; /** * A query that uses a filters with a script associated with them to compute the score. - * - * */ public class CustomFiltersScoreQueryBuilder extends BaseQueryBuilder { @@ -40,6 +38,8 @@ public class CustomFiltersScoreQueryBuilder extends BaseQueryBuilder { private float boost = -1; + private Float maxBoost; + private Map params = null; private String scoreMode; @@ -102,6 +102,11 @@ public class CustomFiltersScoreQueryBuilder extends BaseQueryBuilder { return this; } + public CustomFiltersScoreQueryBuilder maxBoost(float maxBoost) { + this.maxBoost = maxBoost; + return this; + } + /** * Sets the boost for this query. Documents matching this query will (in addition to the normal * weightings) have their score multiplied by the boost provided. @@ -135,6 +140,9 @@ public class CustomFiltersScoreQueryBuilder extends BaseQueryBuilder { if (scoreMode != null) { builder.field("score_mode", scoreMode); } + if (maxBoost != null) { + builder.field("max_boost", maxBoost); + } if (lang != null) { builder.field("lang", lang);