Skip to content

Commit 773c33a

Browse files
committed
Renamed SimplifiedInnerRetrieverUtils to MultiFieldsInnerRetrieverUtils
1 parent 2c8085d commit 773c33a

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
package org.elasticsearch.xpack.rank.simplified;
8+
package org.elasticsearch.xpack.rank;
99

1010
import org.elasticsearch.action.ActionRequestValidationException;
1111
import org.elasticsearch.cluster.metadata.IndexMetadata;
@@ -32,12 +32,12 @@
3232
import static org.elasticsearch.action.ValidateActions.addValidationError;
3333
import static org.elasticsearch.index.IndexSettings.DEFAULT_FIELD_SETTING;
3434

35-
public class SimplifiedInnerRetrieverUtils {
36-
private SimplifiedInnerRetrieverUtils() {}
35+
public class MultiFieldsInnerRetrieverUtils {
36+
private MultiFieldsInnerRetrieverUtils() {}
3737

3838
public record WeightedRetrieverSource(CompoundRetrieverBuilder.RetrieverSource retrieverSource, float weight) {}
3939

40-
public static ActionRequestValidationException validateSimplifiedFormatParams(
40+
public static ActionRequestValidationException validateParams(
4141
List<CompoundRetrieverBuilder.RetrieverSource> innerRetrievers,
4242
List<String> fields,
4343
@Nullable String query,
@@ -48,7 +48,7 @@ public static ActionRequestValidationException validateSimplifiedFormatParams(
4848
ActionRequestValidationException validationException
4949
) {
5050
if (fields.isEmpty() == false || query != null) {
51-
// Using the simplified query format
51+
// Using the multi-fields query format
5252
if (query == null) {
5353
// Return early here because the following validation checks assume a query param value is provided
5454
return addValidationError(

x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/linear/LinearRetrieverBuilder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import org.elasticsearch.xcontent.XContentBuilder;
2929
import org.elasticsearch.xcontent.XContentParser;
3030
import org.elasticsearch.xpack.core.XPackPlugin;
31+
import org.elasticsearch.xpack.rank.MultiFieldsInnerRetrieverUtils;
3132
import org.elasticsearch.xpack.rank.rrf.RRFRankPlugin;
32-
import org.elasticsearch.xpack.rank.simplified.SimplifiedInnerRetrieverUtils;
3333

3434
import java.io.IOException;
3535
import java.util.ArrayList;
@@ -173,7 +173,7 @@ public ActionRequestValidationException validate(
173173
boolean allowPartialSearchResults
174174
) {
175175
validationException = super.validate(source, validationException, isScroll, allowPartialSearchResults);
176-
validationException = SimplifiedInnerRetrieverUtils.validateSimplifiedFormatParams(
176+
validationException = MultiFieldsInnerRetrieverUtils.validateParams(
177177
innerRetrievers,
178178
fields,
179179
query,
@@ -284,7 +284,7 @@ protected RetrieverBuilder doRewrite(QueryRewriteContext ctx) {
284284

285285
ResolvedIndices resolvedIndices = ctx.getResolvedIndices();
286286
if (resolvedIndices != null && query != null) {
287-
// Using the simplified query format
287+
// Using the multi-fields query format
288288
var localIndicesMetadata = resolvedIndices.getConcreteLocalIndicesMetadata();
289289
if (localIndicesMetadata.size() > 1) {
290290
throw new IllegalArgumentException(
@@ -296,7 +296,7 @@ protected RetrieverBuilder doRewrite(QueryRewriteContext ctx) {
296296
);
297297
}
298298

299-
List<RetrieverSource> fieldsInnerRetrievers = SimplifiedInnerRetrieverUtils.generateInnerRetrievers(
299+
List<RetrieverSource> fieldsInnerRetrievers = MultiFieldsInnerRetrieverUtils.generateInnerRetrievers(
300300
fields,
301301
query,
302302
localIndicesMetadata.values(),

x-pack/plugin/rank-rrf/src/test/java/org/elasticsearch/xpack/rank/linear/LinearRetrieverBuilderTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import static org.elasticsearch.search.rank.RankBuilder.DEFAULT_RANK_WINDOW_SIZE;
3838

3939
public class LinearRetrieverBuilderTests extends ESTestCase {
40-
public void testSimplifiedParamsRewrite() {
40+
public void testMultiFieldsParamsRewrite() {
4141
final String indexName = "test-index";
4242
final List<String> testInferenceFields = List.of("semantic_field_1", "semantic_field_2");
4343
final ResolvedIndices resolvedIndices = createMockResolvedIndices(indexName, testInferenceFields, null);
@@ -60,7 +60,7 @@ public void testSimplifiedParamsRewrite() {
6060
new float[0],
6161
new ScoreNormalizer[0]
6262
);
63-
assertSimplifiedParamsRewrite(
63+
assertMultiFieldsParamsRewrite(
6464
retriever,
6565
queryRewriteContext,
6666
Map.of("field_1", 1.0f, "field_2", 1.0f),
@@ -79,7 +79,7 @@ public void testSimplifiedParamsRewrite() {
7979
new float[0],
8080
new ScoreNormalizer[0]
8181
);
82-
assertSimplifiedParamsRewrite(
82+
assertMultiFieldsParamsRewrite(
8383
retriever,
8484
queryRewriteContext,
8585
Map.of("field_1", 1.0f, "field_2", 1.0f),
@@ -98,7 +98,7 @@ public void testSimplifiedParamsRewrite() {
9898
new float[0],
9999
new ScoreNormalizer[0]
100100
);
101-
assertSimplifiedParamsRewrite(
101+
assertMultiFieldsParamsRewrite(
102102
retriever,
103103
queryRewriteContext,
104104
Map.of("field_1", 1.0f, "field_2", 1.5f),
@@ -117,7 +117,7 @@ public void testSimplifiedParamsRewrite() {
117117
new float[0],
118118
new ScoreNormalizer[0]
119119
);
120-
assertSimplifiedParamsRewrite(
120+
assertMultiFieldsParamsRewrite(
121121
retriever,
122122
queryRewriteContext,
123123
Map.of("field_*", 1.5f, "*_field_1", 2.5f),
@@ -136,7 +136,7 @@ public void testSimplifiedParamsRewrite() {
136136
new float[0],
137137
new ScoreNormalizer[0]
138138
);
139-
assertSimplifiedParamsRewrite(
139+
assertMultiFieldsParamsRewrite(
140140
retriever,
141141
queryRewriteContext,
142142
Map.of("field_*", 1.5f, "field_1", 3.0f, "*_field_1", 2.5f, "semantic_*", 1.5f),
@@ -155,7 +155,7 @@ public void testSimplifiedParamsRewrite() {
155155
new float[0],
156156
new ScoreNormalizer[0]
157157
);
158-
assertSimplifiedParamsRewrite(
158+
assertMultiFieldsParamsRewrite(
159159
retriever,
160160
queryRewriteContext,
161161
Map.of("*", 1.0f),
@@ -229,7 +229,7 @@ private static ResolvedIndices createMockResolvedIndices(
229229
);
230230
}
231231

232-
private static void assertSimplifiedParamsRewrite(
232+
private static void assertMultiFieldsParamsRewrite(
233233
LinearRetrieverBuilder retriever,
234234
QueryRewriteContext ctx,
235235
Map<String, Float> expectedNonInferenceFields,

0 commit comments

Comments
 (0)