diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.retrievers/30_rescorer_retriever.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.retrievers/30_rescorer_retriever.yml index 192f30c867760..2c16de61c6b15 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.retrievers/30_rescorer_retriever.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.retrievers/30_rescorer_retriever.yml @@ -202,7 +202,7 @@ setup: --- "Rescorer retriever and invalid window size": - do: - catch: "/rescorer requires \\[window_size: 5\\] be greater than or equal to \\[size: 10\\]/" + catch: "/\\[rescorer\\] requires \\[window_size: 5\\] be greater than or equal to \\[size: 10\\]/" search: index: test body: diff --git a/server/src/main/java/org/elasticsearch/search/retriever/CompoundRetrieverBuilder.java b/server/src/main/java/org/elasticsearch/search/retriever/CompoundRetrieverBuilder.java index 448aef9882b46..298340e5c579e 100644 --- a/server/src/main/java/org/elasticsearch/search/retriever/CompoundRetrieverBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/retriever/CompoundRetrieverBuilder.java @@ -223,7 +223,7 @@ public ActionRequestValidationException validate( validationException = addValidationError( String.format( Locale.ROOT, - "%s requires [%s: %d] be greater than or equal to [size: %d]", + "[%s] requires [%s: %d] be greater than or equal to [size: %d]", getName(), getRankWindowSizeField().getPreferredName(), rankWindowSize, @@ -247,7 +247,7 @@ public ActionRequestValidationException validate( if (rankWindowSize > compoundChild.rankWindowSize) { String errorMessage = String.format( Locale.ROOT, - "%s requires [%s: %d] to be smaller than or equal to its sub retriever's %s [%s: %d]", + "[%s] requires [%s: %d] to be smaller than or equal to its sub retriever's %s [%s: %d]", this.getName(), getRankWindowSizeField().getPreferredName(), rankWindowSize, diff --git a/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/900_rrf_with_rescorer.yml b/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/900_rrf_with_rescorer.yml index 2365c48aa0d0d..c825ede6fccf0 100644 --- a/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/900_rrf_with_rescorer.yml +++ b/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/900_rrf_with_rescorer.yml @@ -325,7 +325,7 @@ setup: --- "RRF with rescorer retriever and invalid window size": - do: - catch: "/rescorer requires \\[window_size: 5\\] be greater than or equal to \\[size: 10\\]/" + catch: "/\\[rescorer\\] requires \\[window_size: 5\\] be greater than or equal to \\[size: 10\\]/" search: index: test body: @@ -367,7 +367,7 @@ setup: size: 10 - do: - catch: "/rescorer requires \\[window_size: 10\\] to be smaller than or equal to its sub retriever's rrf \\[rank_window_size: 5\\]/" + catch: "/\\[rescorer\\] requires \\[window_size: 10\\] to be smaller than or equal to its sub retriever's rrf \\[rank_window_size: 5\\]/" search: index: test body: