Skip to main content

nodedb_fts/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2
3//! Full-text search engine shared by Origin, Lite, and WASM: BMW-optimized
4//! BM25 with 128-doc block pruning, 16 Snowball stemmers, 27-language stop
5//! words, CJK bigram tokenization (always available) plus optional
6//! dictionary segmentation (lindera/jieba/icu) wired in unconditionally,
7//! posting compression (delta + variable-width bitpack + SIMD unpack),
8//! LSM segment store, fuzzy match, synonyms, highlighting, n-gram /
9//! edge-ngram, and hybrid vector+text fusion.
10//!
11//! FTS is a cross-engine *overlay* — it indexes text fields from any
12//! collection without owning the row storage. Analyzer choice is made per
13//! collection at DDL time via `WITH (analyzer='...')`.
14
15pub mod analyzer;
16pub mod backend;
17pub mod block;
18pub mod bm25;
19pub mod codec;
20pub mod fuzzy;
21pub mod highlight;
22pub mod index;
23pub mod lsm;
24pub mod posting;
25pub mod search;
26
27pub use analyzer::{
28    AnalyzerRegistry, EdgeNgramAnalyzer, KeywordAnalyzer, LanguageAnalyzer, NgramAnalyzer,
29    SimpleAnalyzer, StandardAnalyzer, SynonymMap, TextAnalyzer, analyze,
30};
31pub use backend::FtsBackend;
32pub use block::{CompactPosting, PostingBlock};
33pub use fuzzy::{fuzzy_discount, fuzzy_match, levenshtein, max_distance_for_length};
34pub use index::{FtsIndex, FtsIndexError, MAX_INDEXABLE_SURROGATE, SynonymGroupRecord};
35pub use nodedb_types::Surrogate;
36pub use posting::{Bm25Params, MatchOffset, Posting, QueryMode, TextSearchResult};
37pub use search::query_parser::{InvalidQuery, ParsedQuery};