mirror of
https://github.com/lancedb/lancedb.git
synced 2026-05-20 21:40:43 +00:00
Add skip_merge option for FTS indexes
This commit is contained in:
@@ -558,6 +558,12 @@ export interface FtsOptions {
|
||||
* whether to only index the prefix of the token for ngram tokenizer
|
||||
*/
|
||||
prefixOnly?: boolean;
|
||||
|
||||
/**
|
||||
* Whether to skip the partition merge stage after indexing.
|
||||
* Useful for distributed indexing where merges are handled separately.
|
||||
*/
|
||||
skipMerge?: boolean;
|
||||
}
|
||||
|
||||
export class Index {
|
||||
@@ -726,6 +732,7 @@ export class Index {
|
||||
options?.ngramMinLength,
|
||||
options?.ngramMaxLength,
|
||||
options?.prefixOnly,
|
||||
options?.skipMerge,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -157,6 +157,7 @@ impl Index {
|
||||
ngram_min_length: Option<u32>,
|
||||
ngram_max_length: Option<u32>,
|
||||
prefix_only: Option<bool>,
|
||||
skip_merge: Option<bool>,
|
||||
) -> Self {
|
||||
let mut opts = FtsIndexBuilder::default();
|
||||
if let Some(with_position) = with_position {
|
||||
@@ -192,6 +193,9 @@ impl Index {
|
||||
if let Some(prefix_only) = prefix_only {
|
||||
opts = opts.ngram_prefix_only(prefix_only);
|
||||
}
|
||||
if let Some(skip_merge) = skip_merge {
|
||||
opts = opts.skip_merge(skip_merge);
|
||||
}
|
||||
|
||||
Self {
|
||||
inner: Mutex::new(Some(LanceDbIndex::FTS(opts))),
|
||||
|
||||
Reference in New Issue
Block a user