Skip to content

Commit c3f97c9

Browse files
committed
minor tweaks
1 parent 58a397b commit c3f97c9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,6 +2740,7 @@ && isNotUnitVector(squaredMagnitude)) {
27402740
.add(filter, BooleanClause.Occur.FILTER)
27412741
.build();
27422742
} else if (indexOptions instanceof BBQIVFIndexOptions bbqIndexOptions) {
2743+
float visitedRatio = 0.05f; // TODO: this is fixed to 5% <-- tweak this with a linear transformation from num_candidates?
27432744
knnQuery = parentFilter != null
27442745
? new DiversifyingChildrenIVFKnnFloatVectorQuery(
27452746
name(),
@@ -2749,9 +2750,9 @@ && isNotUnitVector(squaredMagnitude)) {
27492750
filter,
27502751
parentFilter,
27512752
bbqIndexOptions.defaultNProbe,
2752-
1f
2753+
visitedRatio
27532754
)
2754-
: new IVFKnnFloatVectorQuery(name(), queryVector, adjustedK, numCands, filter, bbqIndexOptions.defaultNProbe, 1);
2755+
: new IVFKnnFloatVectorQuery(name(), queryVector, adjustedK, numCands, filter, bbqIndexOptions.defaultNProbe, visitedRatio);
27552756
} else {
27562757
knnQuery = parentFilter != null
27572758
? new ESDiversifyingChildrenFloatKnnVectorQuery(

0 commit comments

Comments
 (0)