Module query

Module query 

Source

Structs§

QueryPlan
A unified plan holding the parsed AST and a mapping of each AST term to an index. We store a map for quick lookups of term indices.

Functions§

build_combined_pattern
Build a combined regex pattern from a list of terms This creates a single pattern that matches any of the terms using case-insensitive matching without word boundaries for more flexible matching
create_query_plan
Create a QueryPlan from a raw query string. This fully parses the query into an AST, then extracts all terms (including excluded), and prepares a term-index map.
create_structured_patterns
Generate regex patterns that respect the AST’s logical structure. This creates a single combined pattern for all terms, regardless of whether they’re required, optional, or negative.
regex_escape
Escapes special regex characters in a string