Skip to content

Commit d2c439f

Browse files
committed
Removed references to simplified query format from error messages
1 parent 488ecf5 commit d2c439f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ public RRFRetrieverBuilder(
116116
this.fields = fields == null ? List.of() : List.copyOf(fields);
117117
this.query = query;
118118
this.rankConstant = rankConstant;
119-
120-
// TODO: Validate simplified query format args here?
121-
// Otherwise some of the validation is skipped when creating the retriever programmatically.
122119
}
123120

124121
public int rankConstant() {
@@ -221,15 +218,15 @@ protected RetrieverBuilder doRewrite(QueryRewriteContext ctx) {
221218

222219
ResolvedIndices resolvedIndices = ctx.getResolvedIndices();
223220
if (resolvedIndices != null && query != null) {
224-
// Using the simplified query format
221+
// Using the multi-fields query format
225222
var localIndicesMetadata = resolvedIndices.getConcreteLocalIndicesMetadata();
226223
if (localIndicesMetadata.size() > 1) {
227224
throw new IllegalArgumentException(
228-
"[" + NAME + "] does not support the simplified query format when querying multiple indices"
225+
"[" + NAME + "] cannot specify [" + QUERY_FIELD.getPreferredName() + "] when querying multiple indices"
229226
);
230227
} else if (resolvedIndices.getRemoteClusterIndices().isEmpty() == false) {
231228
throw new IllegalArgumentException(
232-
"[" + NAME + "] does not support the simplified query format when querying remote indices"
229+
"[" + NAME + "] cannot specify [" + QUERY_FIELD.getPreferredName() + "] when querying remote indices"
233230
);
234231
}
235232

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public void testSearchRemoteIndex() {
189189
IllegalArgumentException.class,
190190
() -> rrfRetrieverBuilder.doRewrite(queryRewriteContext)
191191
);
192-
assertEquals("[rrf] does not support the simplified query format when querying remote indices", iae.getMessage());
192+
assertEquals("[rrf] cannot specify [query] when querying remote indices", iae.getMessage());
193193
}
194194

195195
@Override

0 commit comments

Comments
 (0)