feat: enable prefilter in node js (#675)

enable prefiltering in node js, both native and remote
This commit is contained in:
Rob Meng
2023-12-01 16:49:10 -05:00
committed by Weston Pace
parent c1c3083b74
commit 59c25574f0
5 changed files with 30 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ export class Query<T = number[]> {
private _select?: string[]
private _filter?: string
private _metricType?: MetricType
private _prefilter: boolean
protected readonly _embeddings?: EmbeddingFunction<T>
constructor (query: T, tbl?: any, embeddings?: EmbeddingFunction<T>) {
@@ -44,6 +45,7 @@ export class Query<T = number[]> {
this._filter = undefined
this._metricType = undefined
this._embeddings = embeddings
this._prefilter = false
}
/***
@@ -102,6 +104,11 @@ export class Query<T = number[]> {
return this
}
prefilter (value: boolean): Query<T> {
this._prefilter = value
return this
}
/**
* Execute the query and return the results as an Array of Objects
*/