Skip to main content

Module schema

Module schema 

Source
Expand description

Tantivy schema for the text index.

One document per distinct string-literal term:

fieldtypecontent
termbytes, fastencoded EncodedTerm; the candidate payload
texttext, configured analyzerfull lexical, for text:query
text_begintext, raw tokenizerfirst seed_chars characters
text_endtext, raw tokenizerreversed last seed_chars characters
langtext, raw tokenizerlanguage tag, or LANG_NONE

text_begin and text_end hold whole strings, not tokens, so a prefix query over them is string-prefix matching. The suffix field is reversed so that a suffix query is a prefix query on the reversed seed and the FST term dictionary can seek it; without the reversal a suffix query would have to walk the whole term dictionary.

Structs§

TextSchema
Resolved fields of one index, so callers never look them up by name.

Constants§

FIELD_KEY
Logical document identity (predicate, literal) (indexed; delete_term target for the upsert).
FIELD_LANG
Language tag (raw), or LANG_NONE.
FIELD_PREDICATE
Encoded predicate term (indexed; the predicate-scoping dimension).
FIELD_TERM
Encoded term bytes (fast field).
FIELD_TEXT
Analyzed full lexical, used by text:query.
FIELD_TEXT_BEGIN
Bounded forward prefix of the lexical.
FIELD_TEXT_END
Bounded reversed suffix of the lexical.
MAX_ANALYZED_TOKEN_BYTES
Longest token the analyzers emit, in bytes. Tokens longer than this are dropped, which is the standard full-text behaviour for unbroken blobs and only affects text:query (the bounded prefix/suffix fields are raw and truncated to the seed length separately).

Functions§

build
Build the schema for analyzer (a menu value of waratah_storage::text_index::ANALYZERS).
from_index
Resolve the schema of an already-open index.
language_value
The sentinel stored in lang for a literal without a language tag.
register_analyzers
Register the analyzer menu on index.
text_tokenizer
The tokenizer name of the analyzed text field.