feat: support distance range in queries (#1999)

this also updates the docs

---------

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
This commit is contained in:
BubbleCal
2025-01-08 11:03:27 +08:00
committed by GitHub
parent 0e496ed3b5
commit 3c0a64be8f
8 changed files with 337 additions and 3 deletions

View File

@@ -388,6 +388,19 @@ export class VectorQuery extends QueryBase<NativeVectorQuery> {
return this;
}
/*
* Set the distance range to use
*
* Only rows with distances within range [lower_bound, upper_bound)
* will be returned.
*
* `undefined` means no lower or upper bound.
*/
distanceRange(lowerBound?: number, upperBound?: number): VectorQuery {
super.doCall((inner) => inner.distanceRange(lowerBound, upperBound));
return this;
}
/**
* Set the number of candidates to consider during the search
*