mirror of
https://github.com/lancedb/lancedb.git
synced 2026-05-23 23:10:40 +00:00
feat(nodejs): add bitmap and label list index types in nodejs (#1532)
This commit is contained in:
@@ -176,6 +176,29 @@ export class Index {
|
||||
return new Index(LanceDbIndex.btree());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a bitmap index.
|
||||
*
|
||||
* A `Bitmap` index stores a bitmap for each distinct value in the column for every row.
|
||||
*
|
||||
* This index works best for low-cardinality columns, where the number of unique values
|
||||
* is small (i.e., less than a few hundreds).
|
||||
*/
|
||||
static bitmap() {
|
||||
return new Index(LanceDbIndex.bitmap());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a label list index.
|
||||
*
|
||||
* LabelList index is a scalar index that can be used on `List<T>` columns to
|
||||
* support queries with `array_contains_all` and `array_contains_any`
|
||||
* using an underlying bitmap index.
|
||||
*/
|
||||
static labelList() {
|
||||
return new Index(LanceDbIndex.labelList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a full text search index
|
||||
*
|
||||
|
||||
@@ -151,7 +151,7 @@ export class QueryBase<NativeQueryType extends NativeQuery | NativeVectorQuery>
|
||||
query: string,
|
||||
options?: Partial<FullTextSearchOptions>,
|
||||
): this {
|
||||
let columns = null;
|
||||
let columns: string[] | null = null;
|
||||
if (options) {
|
||||
if (typeof options.columns === "string") {
|
||||
columns = [options.columns];
|
||||
|
||||
Reference in New Issue
Block a user