waratah_text_index/lib.rs
1//! Partition-side text index engine for the Waratah text plugin.
2//!
3//! One [Tantivy](https://github.com/quickwit-oss/tantivy) directory per O
4//! partition, holding one document per distinct string-literal term. Two
5//! search structures live in that document:
6//!
7//! - the analyzed `text` field, for Jena-style `text:query` token search;
8//! - the bounded `text_begin` / `text_end` fields, for exact prefix and suffix
9//! candidate queries. `text_end` stores the last `seed_chars` characters
10//! **reversed**, so a suffix query is a prefix query and the FST term
11//! dictionary can seek it instead of walking the whole vocabulary.
12//!
13//! This crate deliberately has no dependency on `waratah_compute`: the O
14//! partition and the offline CLI use it directly, while the compute-side plugin
15//! depends on it for schema and document construction. Terms are opaque bytes
16//! here — encoding and registry resolution belong to the callers.
17//!
18//! The index is derived data. It is never retracted on delete, it is rebuilt
19//! from the hexastore when lost, and it is only trusted once a build has
20//! stamped an epoch into [`meta::TextIndexMeta`].
21
22#![warn(missing_docs)]
23
24pub mod doc;
25pub mod error;
26pub mod index;
27pub mod meta;
28pub mod query;
29pub mod schema;
30pub mod scratch;
31
32pub use error::TextIndexError;
33pub use index::{TextIndex, TextIndexOptions};
34pub use meta::{SKETCH_FILE, TextIndexMeta};
35pub use query::build_query;
36pub use waratah_storage::text_index::{
37 ANALYZERS, DEFAULT_ANALYZER, DEFAULT_SEED_CHARS, LANG_NONE, MAX_SEED_CHARS, RAW_TOKENIZER,
38 TextCandidateMode, TextIndexDoc, TextSearchRequest, registered_analyzer,
39};