Skip to main content

sqlrite/sql/fts/
mod.rs

1//! Full-text search (FTS) — inverted-index keyword retrieval with BM25
2//! ranking. Pure algorithms; no SQL integration in this module.
3//!
4//! Phase 8 of the SQLRite roadmap; see `docs/phase-8-plan.md`.
5//!
6//! - [`tokenizer`] — split text into terms (ASCII MVP per Q3).
7//! - [`bm25`] — BM25 relevance scoring (`k1 = 1.5`, `b = 0.75`, fixed per
8//!   Q4 + Q5; no stemming, no stop list).
9//! - [`posting_list`] — in-memory inverted index keyed by term, holding
10//!   per-document term frequencies + lengths. Insert / remove / query.
11//!
12//! Phase 8a shipped these standalone algorithms; Phase 8b wires them
13//! into the SQL surface (`CREATE INDEX … USING fts(<col>)`,
14//! `fts_match`, `bm25_score`, the `try_fts_probe` optimizer hook).
15//! Persistence of the posting lists themselves arrives with Phase 8c
16//! (`KIND_FTS_POSTING` cell encoding).
17
18pub mod bm25;
19pub mod posting_list;
20pub mod tokenizer;
21
22pub use bm25::{Bm25Params, score as bm25_score};
23pub use posting_list::PostingList;
24pub use tokenizer::tokenize;