@@ -2173,24 +2173,25 @@ private void checkFullTextFunctionNullArgs(String functionInvocation, String arg
21732173 );
21742174 }
21752175
2176- public void testFullTextFunctionsConstantQuery () throws Exception {
2177- checkFullTextFunctionsConstantQuery ("match(title, category)" , "second" );
2178- checkFullTextFunctionsConstantQuery ("qstr(title)" , "" );
2179- checkFullTextFunctionsConstantQuery ("kql(title)" , "" );
2180- checkFullTextFunctionsConstantQuery ("match_phrase(title, tags)" , "second" );
2176+ public void testFullTextFunctionsConstantArg () throws Exception {
2177+ checkFullTextFunctionsConstantArg ("match(title, category)" , "second" );
2178+ checkFullTextFunctionsConstantArg ("qstr(title)" , "" );
2179+ checkFullTextFunctionsConstantArg ("kql(title)" , "" );
2180+ checkFullTextFunctionsConstantArg ("match_phrase(title, tags)" , "second" );
21812181 if (EsqlCapabilities .Cap .MULTI_MATCH_FUNCTION .isEnabled ()) {
2182- checkFullTextFunctionsConstantQuery ("multi_match(category, body)" , "first" );
2183- checkFullTextFunctionsConstantQuery ("multi_match(concat(title, \" world\" ), title)" , "first" );
2182+ checkFullTextFunctionsConstantArg ("multi_match(category, body)" , "first" );
2183+ checkFullTextFunctionsConstantArg ("multi_match(concat(title, \" world\" ), title)" , "first" );
21842184 }
21852185 if (EsqlCapabilities .Cap .TERM_FUNCTION .isEnabled ()) {
2186- checkFullTextFunctionsConstantQuery ("term(title, tags)" , "second" );
2186+ checkFullTextFunctionsConstantArg ("term(title, tags)" , "second" );
21872187 }
21882188 if (EsqlCapabilities .Cap .KNN_FUNCTION .isEnabled ()) {
2189- checkFullTextFunctionsConstantQuery ("knn(vector, vector, 10)" , "second" );
2189+ checkFullTextFunctionsConstantArg ("knn(vector, vector, 10)" , "second" );
2190+ checkFullTextFunctionsConstantArg ("knn(vector, [0, 1, 2], category)" , "third" );
21902191 }
21912192 }
21922193
2193- private void checkFullTextFunctionsConstantQuery (String functionInvocation , String argOrdinal ) throws Exception {
2194+ private void checkFullTextFunctionsConstantArg (String functionInvocation , String argOrdinal ) throws Exception {
21942195 assertThat (
21952196 error ("from test | where " + functionInvocation , fullTextAnalyzer ),
21962197 containsString (argOrdinal + " argument of [" + functionInvocation + "] must be a constant" )
0 commit comments