|
7 | 7 |
|
8 | 8 | package org.elasticsearch.action.fieldcaps; |
9 | 9 |
|
| 10 | +import org.apache.lucene.search.join.ScoreMode; |
10 | 11 | import org.elasticsearch.action.ActionRequestValidationException; |
11 | 12 | import org.elasticsearch.index.query.BoolQueryBuilder; |
12 | 13 | import org.elasticsearch.index.query.BoostingQueryBuilder; |
|
19 | 20 | import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder; |
20 | 21 | import org.elasticsearch.test.ESTestCase; |
21 | 22 | import org.elasticsearch.xpack.inference.queries.SemanticQueryBuilder; |
22 | | -import org.apache.lucene.search.join.ScoreMode; |
23 | 23 |
|
24 | 24 | import static org.hamcrest.Matchers.containsString; |
25 | 25 | import static org.hamcrest.Matchers.notNullValue; |
@@ -70,10 +70,7 @@ public void testValidateWithRandomCompoundQueryContainingSemantic() { |
70 | 70 | } |
71 | 71 |
|
72 | 72 | private static SemanticQueryBuilder randomSemanticQuery() { |
73 | | - return new SemanticQueryBuilder( |
74 | | - randomAlphaOfLength(5), |
75 | | - randomAlphaOfLength(10) |
76 | | - ); |
| 73 | + return new SemanticQueryBuilder(randomAlphaOfLength(5), randomAlphaOfLength(10)); |
77 | 74 | } |
78 | 75 |
|
79 | 76 | private static QueryBuilder randomNonSemanticQuery() { |
@@ -120,11 +117,7 @@ private static QueryBuilder randomCompoundQueryWithSemantic(int depth) { |
120 | 117 | } |
121 | 118 | yield disMax; |
122 | 119 | } |
123 | | - case 2 -> new NestedQueryBuilder( |
124 | | - randomAlphaOfLength(5), |
125 | | - randomCompoundQueryWithSemantic(depth - 1), |
126 | | - ScoreMode.Max |
127 | | - ); |
| 120 | + case 2 -> new NestedQueryBuilder(randomAlphaOfLength(5), randomCompoundQueryWithSemantic(depth - 1), ScoreMode.Max); |
128 | 121 | case 3 -> { |
129 | 122 | boolean positiveSemanticQuery = randomBoolean(); |
130 | 123 | QueryBuilder semanticQuery = randomCompoundQueryWithSemantic(depth - 1); |
|
0 commit comments