4 releases
Uses new Rust 2024
| new 0.1.3 | May 14, 2026 |
|---|---|
| 0.1.2 | Mar 22, 2026 |
| 0.1.1 | Feb 22, 2026 |
| 0.1.0 | Feb 21, 2026 |
#2123 in Parser implementations
Used in fsqlite
1.5MB
33K
SLoC
fsqlite-ext-fts3
FTS3/FTS4 full-text search extension for FrankenSQLite.
Overview
This crate implements the FTS3 and FTS4 full-text search extensions. It provides query tokenization and validation (with explicit boolean operators AND, OR, NOT, NEAR, and phrase matching), matchinfo format validation and width computation, and offsets parsing/formatting. FTS3 is the legacy full-text search module; FTS4 is its backward-compatible successor with additional features.
This is a leaf crate in the fsqlite workspace dependency graph. It depends on fsqlite-types, fsqlite-error, and fsqlite-func.
Key Types
FtsDialect- Enum distinguishingFts3andFts4dialectsQueryToken- A parsed token from a full-text query, carrying aQueryTokenKindand the original lexemeQueryTokenKind- Token classification:Term,Phrase,And,Or,Not,Near,LParen,RParenQueryValidationError- Error enum:EmptyQuery,UnclosedPhrase,UnbalancedParentheses,ImplicitAndMatchinfoFormatError- Error enum for matchinfo format strings:EmptyFormat,InvalidChar,ArithmeticOverflowOffsetEntry- A single offset record with column, term, byte_offset, and byte_length fieldsOffsetsParseError- Error enum for offsets parsing:InvalidFieldCount,InvalidInteger
Key Functions
extension_name()- Returns"fts3"supports_dialect(dialect)- Returns whether the given FTS dialect is supportedparse_query(query)- Tokenize and validate an FTS3/4 query string, rejecting implicit AND and unbalanced parenthesesvalidate_matchinfo_format(format)- Validate a matchinfo format string against the allowed character set (p,c,n,a,l,s,x)matchinfo_u32_width(format, phrase_count, column_count)- Compute the u32 output width for a matchinfo format stringparse_offsets(payload)/format_offsets(entries)- Parse and format FTS3/4 offsets function outputis_matchinfo_format_char(ch)- Check whether a character is valid in a matchinfo format string
Dependencies
fsqlite-typesfsqlite-errorfsqlite-func
License
MIT
Dependencies
~7–11MB
~144K SLoC