Replies: 3 comments
-
|
+1 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
+1 (binding) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
+1 (binding) for the proposal in the PR. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
This proposal extends
InvertedIndexDetailsso an FTS index persists the effective tokenizer configuration required to reconstruct its indexed term space.Analyzer profiles such as
coderemain input-time presets. They are expanded into a document tokenizer, lexical tokenizer, and concrete tokenizer options before index details are persisted.Problem
FTS queries, index updates, and segment merges must use the same tokenization behavior that was used when the index was created. Persisting only
base_tokenizeris insufficient for code search because the resulting term space also depends on:If these values are reconstructed from current defaults instead of persisted values, reopening or merging an index can produce terms that do not match the existing postings.
Proposed Design
Extend
InvertedIndexDetailswith the following fields:lance_tokenizerandbase_tokenizerrepresent separate stages:lance_tokenizerextracts searchable text from the stored value.base_tokenizerperforms lexical tokenization on that text.This allows configurations such as JSON documents containing code to be represented as:
Analyzer profiles are not persisted. For example,
analyzer="code"is resolved intobase_tokenizer="code"and concrete values for stemming, stop-word removal, identifier splitting, and other tokenizer options.The persisted details therefore describe effective behavior rather than the preset used to produce it.
split_on_numericsandpreserve_originaluse proto presence because their code-tokenizer defaults aretrue. An absent value must be distinguishable from an explicitfalse.split_identifiersandindex_operatorsuse regular booleans because their defaults arefalse.The format maintains these invariants:
Compatibility and Migration
Existing indexes do not contain the new fields.
When
lance_tokenizeris absent, readers infer it from the indexed column type and canonicalize the result before comparing segments.When code-specific optional fields are absent, readers derive their defaults from
base_tokenizer. Existing text indexes therefore retain their current behavior.Older readers ignore the new protobuf fields. New readers can open both old and new indexes. New writers persist the resolved effective configuration so future reads, updates, and segment merges do not depend on client-side defaults.
Beta Was this translation helpful? Give feedback.
All reactions