We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66e3dcb commit 71d3a48Copy full SHA for 71d3a48
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/querydsl/query/KnnQuery.java
@@ -54,6 +54,7 @@ protected QueryBuilder asBuilder() {
54
Float vectorSimilarity = (Float) options.get(VECTOR_SIMILARITY_FIELD.getPreferredName());
55
Integer minCandidates = (Integer) options.get(Knn.MIN_CANDIDATES_OPTION);
56
int adjustedK = Math.max(k, minCandidates == null ? 0 : minCandidates);
57
+ minCandidates = minCandidates == null ? null : Math.max(minCandidates, adjustedK);
58
59
KnnVectorQueryBuilder queryBuilder = new KnnVectorQueryBuilder(
60
field,
0 commit comments