@@ -1236,7 +1236,7 @@ public void testFieldBasedFullTextFunctions() throws Exception {
12361236 checkFieldBasedFunctionNotAllowedAfterCommands ("Term" , "function" , "term(title, \" Meditation\" )" );
12371237 }
12381238 if (EsqlCapabilities .Cap .KNN_FUNCTION .isEnabled ()) {
1239- checkFieldBasedFunctionNotAllowedAfterCommands ("KNN" , "function" , "knn(vector, [1, 2, 3])" );
1239+ checkFieldBasedFunctionNotAllowedAfterCommands ("KNN" , "function" , "knn(vector, [1, 2, 3], 10 )" );
12401240 }
12411241 }
12421242
@@ -1369,7 +1369,7 @@ public void testFullTextFunctionsOnlyAllowedInWhere() throws Exception {
13691369 checkFullTextFunctionsOnlyAllowedInWhere ("MultiMatch" , "multi_match(\" Meditation\" , title, body)" , "function" );
13701370 }
13711371 if (EsqlCapabilities .Cap .KNN_FUNCTION .isEnabled ()) {
1372- checkFullTextFunctionsOnlyAllowedInWhere ("KNN" , "knn(vector, [0, 1, 2])" , "function" );
1372+ checkFullTextFunctionsOnlyAllowedInWhere ("KNN" , "knn(vector, [0, 1, 2], 10 )" , "function" );
13731373 }
13741374 }
13751375
@@ -1408,7 +1408,7 @@ public void testFullTextFunctionsDisjunctions() {
14081408 checkWithFullTextFunctionsDisjunctions ("term(title, \" Meditation\" )" );
14091409 }
14101410 if (EsqlCapabilities .Cap .KNN_FUNCTION .isEnabled ()) {
1411- checkWithFullTextFunctionsDisjunctions ("knn(vector, [1, 2, 3])" );
1411+ checkWithFullTextFunctionsDisjunctions ("knn(vector, [1, 2, 3], 10 )" );
14121412 }
14131413 }
14141414
@@ -1473,7 +1473,7 @@ public void testFullTextFunctionsWithNonBooleanFunctions() {
14731473 checkFullTextFunctionsWithNonBooleanFunctions ("Term" , "term(title, \" Meditation\" )" , "function" );
14741474 }
14751475 if (EsqlCapabilities .Cap .KNN_FUNCTION .isEnabled ()) {
1476- checkFullTextFunctionsWithNonBooleanFunctions ("KNN" , "knn(vector, [1, 2, 3])" , "function" );
1476+ checkFullTextFunctionsWithNonBooleanFunctions ("KNN" , "knn(vector, [1, 2, 3], 10 )" , "function" );
14771477 }
14781478 }
14791479
@@ -1544,7 +1544,7 @@ public void testFullTextFunctionsTargetsExistingField() throws Exception {
15441544 testFullTextFunctionTargetsExistingField ("term(fist_name, \" Meditation\" )" );
15451545 }
15461546 if (EsqlCapabilities .Cap .KNN_FUNCTION .isEnabled ()) {
1547- testFullTextFunctionTargetsExistingField ("knn(vector, [0, 1, 2])" );
1547+ testFullTextFunctionTargetsExistingField ("knn(vector, [0, 1, 2], 10 )" );
15481548 }
15491549 }
15501550
@@ -2072,7 +2072,7 @@ public void testFullTextFunctionOptions() {
20722072 checkOptionDataTypes (MultiMatch .OPTIONS , "FROM test | WHERE MULTI_MATCH(\" Jean\" , title, body, {\" %s\" : %s})" );
20732073 }
20742074 if (EsqlCapabilities .Cap .KNN_FUNCTION .isEnabled ()) {
2075- checkOptionDataTypes (Knn .ALLOWED_OPTIONS , "FROM test | WHERE KNN(vector, [0.1, 0.2, 0.3], {\" %s\" : %s})" );
2075+ checkOptionDataTypes (Knn .ALLOWED_OPTIONS , "FROM test | WHERE KNN(vector, [0.1, 0.2, 0.3], 10, {\" %s\" : %s})" );
20762076 }
20772077 }
20782078
@@ -2160,8 +2160,9 @@ public void testFullTextFunctionsNullArgs() throws Exception {
21602160 checkFullTextFunctionNullArgs ("term(title, null)" , "second" );
21612161 }
21622162 if (EsqlCapabilities .Cap .KNN_FUNCTION .isEnabled ()) {
2163- checkFullTextFunctionNullArgs ("knn(null, [0, 1, 2])" , "first" );
2164- checkFullTextFunctionNullArgs ("knn(vector, null)" , "second" );
2163+ checkFullTextFunctionNullArgs ("knn(null, [0, 1, 2], 10)" , "first" );
2164+ checkFullTextFunctionNullArgs ("knn(vector, null, 10)" , "second" );
2165+ checkFullTextFunctionNullArgs ("knn(vector, [0, 1, 2], null)" , "third" );
21652166 }
21662167 }
21672168
@@ -2185,7 +2186,7 @@ public void testFullTextFunctionsConstantQuery() throws Exception {
21852186 checkFullTextFunctionsConstantQuery ("term(title, tags)" , "second" );
21862187 }
21872188 if (EsqlCapabilities .Cap .KNN_FUNCTION .isEnabled ()) {
2188- checkFullTextFunctionsConstantQuery ("knn(vector, vector)" , "second" );
2189+ checkFullTextFunctionsConstantQuery ("knn(vector, vector, 10 )" , "second" );
21892190 }
21902191 }
21912192
@@ -2215,7 +2216,7 @@ public void testFullTextFunctionsInStats() {
22152216 checkFullTextFunctionsInStats ("multi_match(\" Meditation\" , title, body)" );
22162217 }
22172218 if (EsqlCapabilities .Cap .KNN_FUNCTION .isEnabled ()) {
2218- checkFullTextFunctionsInStats ("knn(vector, [0, 1, 2])" );
2219+ checkFullTextFunctionsInStats ("knn(vector, [0, 1, 2], 10 )" );
22192220 }
22202221 }
22212222
0 commit comments