Skip to content

Commit 3d55191

Browse files
committed
Fix efficient-filter test to satisfy LIMIT <= k contract
The efficient-filter test used LIMIT 5 with option='k=3', which the branch rejects at push-down time via VectorSearchQueryBuilder#validateLimitWithinK. Change LIMIT to 3 so the query passes validation and actually exercises the k-NN execution path. The discriminator is preserved: query near TX with WHERE state='CA' and k=3 would return zero rows under POST filtering (the three nearest candidates are all TX and get filtered out) and returns exactly {4,5,6} under efficient filtering, which navigates HNSW toward the CA cluster. Signed-off-by: Eric Wei <mengwei.eric@gmail.com>
1 parent 7ae4189 commit 3d55191

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

integ-test/src/test/java/org/opensearch/sql/sql/VectorSearchExecutionIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public void testEfficientFilterReturnsOnlyMatchingDocs() throws IOException {
166166
+ "', field='embedding', "
167167
+ "vector='[1.0, 1.0]', option='k=3,filter_type=efficient') AS v "
168168
+ "WHERE v.state = 'CA' "
169-
+ "LIMIT 5");
169+
+ "LIMIT 3");
170170

171171
assertRowIdsEqual(result, "4", "5", "6");
172172
}

0 commit comments

Comments
 (0)