Skip to content

Commit bb2807c

Browse files
committed
Removed references to simplified query format from error messages
1 parent 1c36d33 commit bb2807c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ protected RetrieverBuilder doRewrite(QueryRewriteContext ctx) {
292292
var localIndicesMetadata = resolvedIndices.getConcreteLocalIndicesMetadata();
293293
if (localIndicesMetadata.size() > 1) {
294294
throw new IllegalArgumentException(
295-
"[" + NAME + "] does not support the simplified query format when querying multiple indices"
295+
"[" + NAME + "] cannot specify [" + QUERY_FIELD.getPreferredName() + "] when querying multiple indices"
296296
);
297297
} else if (resolvedIndices.getRemoteClusterIndices().isEmpty() == false) {
298298
throw new IllegalArgumentException(
299-
"[" + NAME + "] does not support the simplified query format when querying remote indices"
299+
"[" + NAME + "] cannot specify [" + QUERY_FIELD.getPreferredName() + "] when querying remote indices"
300300
);
301301
}
302302

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public void testSearchRemoteIndex() {
191191
);
192192

193193
IllegalArgumentException iae = expectThrows(IllegalArgumentException.class, () -> retriever.doRewrite(queryRewriteContext));
194-
assertEquals("[linear] does not support the simplified query format when querying remote indices", iae.getMessage());
194+
assertEquals("[linear] cannot specify [query] when querying remote indices", iae.getMessage());
195195
}
196196

197197
private static ResolvedIndices createMockResolvedIndices(

x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/linear/20_linear_retriever_simplified.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ setup:
350350
query: "match"
351351
normalizer: "minmax"
352352

353-
- match: { error.root_cause.0.reason: "[linear] does not support the simplified query format when querying multiple indices" }
353+
- match: { error.root_cause.0.reason: "[linear] cannot specify [query] when querying multiple indices" }
354354

355355
- do:
356356
indices.put_alias:
@@ -371,7 +371,7 @@ setup:
371371
query: "match"
372372
normalizer: "minmax"
373373

374-
- match: { error.root_cause.0.reason: "[linear] does not support the simplified query format when querying multiple indices" }
374+
- match: { error.root_cause.0.reason: "[linear] cannot specify [query] when querying multiple indices" }
375375

376376
---
377377
"Wildcard field patterns that do not resolve to any field are handled gracefully":

0 commit comments

Comments
 (0)