File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ public static enum Type {
59
59
60
60
private String analyzer ;
61
61
62
+ private Float boost ;
63
+
62
64
private Integer slop ;
63
65
64
66
private String fuzziness ;
@@ -100,6 +102,14 @@ public TextQueryBuilder analyzer(String analyzer) {
100
102
return this ;
101
103
}
102
104
105
+ /**
106
+ * Set the boost to apply to the query.
107
+ */
108
+ public TextQueryBuilder boost (float boost ) {
109
+ this .boost = boost ;
110
+ return this ;
111
+ }
112
+
103
113
/**
104
114
* Set the phrase slop if evaluated to a phrase query type.
105
115
*/
@@ -139,6 +149,9 @@ public TextQueryBuilder maxExpansions(int maxExpansions) {
139
149
if (analyzer != null ) {
140
150
builder .field ("analyzer" , analyzer );
141
151
}
152
+ if (boost != null ) {
153
+ builder .field ("boost" , boost );
154
+ }
142
155
if (slop != null ) {
143
156
builder .field ("slop" , slop );
144
157
}
You can’t perform that action at this time.
0 commit comments