File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
x-pack/plugin/rank-rrf/src
main/java/org/elasticsearch/xpack/rank/rrf
test/java/org/elasticsearch/xpack/rank/rrf Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments