Skip to main content

Crate waratah_text_index

Crate waratah_text_index 

Source
Expand description

Partition-side text index engine for the Waratah text plugin.

One Tantivy directory per O partition, holding one document per distinct string-literal term. Two search structures live in that document:

  • the analyzed text field, for Jena-style text:query token search;
  • the bounded text_begin / text_end fields, for exact prefix and suffix candidate queries. text_end stores the last seed_chars characters reversed, so a suffix query is a prefix query and the FST term dictionary can seek it instead of walking the whole vocabulary.

This crate deliberately has no dependency on waratah_compute: the O partition and the offline CLI use it directly, while the compute-side plugin depends on it for schema and document construction. Terms are opaque bytes here — encoding and registry resolution belong to the callers.

The index is derived data. It is never retracted on delete, it is rebuilt from the hexastore when lost, and it is only trusted once a build has stamped an epoch into meta::TextIndexMeta.

Re-exports§

pub use error::TextIndexError;
pub use index::TextIndex;
pub use index::TextIndexOptions;
pub use meta::SKETCH_FILE;
pub use meta::TextIndexMeta;
pub use query::build_query;

Modules§

doc
Tantivy document assembly and the bounded seeds derived from a lexical form.
error
Errors of the partition-side text index engine.
index
The partition-side text index: one Tantivy directory per O partition.
meta
Index sidecar metadata: the trust state and the configuration that lives beside the Tantivy directory.
query
Candidate queries for the three search modes.
schema
Tantivy schema for the text index.
scratch
Compute-side evaluation of a text request over in-house terms.

Structs§

TextIndexDoc
One literal to add to the text index.
TextSearchRequest
One candidate drain request.

Enums§

TextCandidateMode
Which candidate query to run against a text index.

Constants§

ANALYZERS
Analyzer menu: config value → tokenizer name registered on the index.
DEFAULT_ANALYZER
Default analyzer name: tokenize, drop over-long tokens, lowercase.
DEFAULT_SEED_CHARS
Default number of characters stored in the bounded prefix and suffix fields.
LANG_NONE
Language-field sentinel for a literal without a language tag.
MAX_SEED_CHARS
Largest accepted seed length.
RAW_TOKENIZER
Tokenizer name used by the bounded seed fields and the language field.

Functions§

registered_analyzer
The registered tokenizer name for a configuration analyzer value.