Skip to content

Commit 4124dc9

Browse files
author
elasticsearchmachine
committed
Fix tests
1 parent 8e7a03c commit 4124dc9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/knn-function.csv-spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ required_capability: knn_function_v5
229229

230230
from colors metadata _score
231231
| eval composed_name = locate(color, " ") > 0
232-
| where knn(rgb_vector, [128,128,0], {"min_candidates": 100}) and composed_name == false
232+
| where knn(rgb_vector, [128,128,0], {"k": 100}) and composed_name == false
233233
| sort _score desc, color asc
234234
| keep color, composed_name
235235
| limit 10

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/plugin/KnnFunctionIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ public void testKnnDefaults() {
113113
}
114114
}
115115

116-
public void testKnnOptions() {
116+
public void testKnnKOverridesLimit() {
117117
float[] queryVector = new float[numDims];
118118
Arrays.fill(queryVector, 0.0f);
119119

120120
var query = String.format(Locale.ROOT, """
121121
FROM test METADATA _score
122-
| WHERE knn(vector, %s)
122+
| WHERE knn(vector, %s, {"k": 5, "min_candidates": 20})
123123
| KEEP id, _score, vector
124124
| SORT _score DESC
125-
| LIMIT 5
125+
| LIMIT 10
126126
""", Arrays.toString(queryVector));
127127

128128
try (var resp = run(query)) {

0 commit comments

Comments
 (0)