Summary
zbsearch currently supports prefix matching (search-as-you-type) via the radix tree, but has no way to match by suffix ("ends-with") or by an infix/wildcard pattern. Several competitors offer this:
- Fuse.js —
$ (suffix-exact) and !$ (not-suffix) extended-search operators
- FlexSearch —
reverse/bidirectional tokenizer for suffix matching
- Lunr — wildcard queries:
*oo (suffix), f*o (infix), foo* (prefix)
Motivation
Matching the tail of a term (file extensions like .js, suffix-heavy morphology, part numbers/SKUs) is impossible today without indexing tricks on the user's side.
Proposed direction
- Consider a reverse radix index (à la FlexSearch
reverse) to make suffix lookups cheap, opt-in per field to avoid the memory cost.
- Alternatively/additionally, support a limited wildcard syntax (
*term, te*rm) in the query, expanded against the radix tree.
Notes / trade-offs
- Suffix indexing roughly doubles the string index memory for fields it's enabled on; should be opt-in.
- Infix/full-substring matching is the most expensive; scope carefully.
Related
Part of a competitive feature-gap review vs Fuse.js, MiniSearch, FlexSearch, Lunr.
Summary
zbsearch currently supports prefix matching (search-as-you-type) via the radix tree, but has no way to match by suffix ("ends-with") or by an infix/wildcard pattern. Several competitors offer this:
$(suffix-exact) and!$(not-suffix) extended-search operatorsreverse/bidirectionaltokenizer for suffix matching*oo(suffix),f*o(infix),foo*(prefix)Motivation
Matching the tail of a term (file extensions like
.js, suffix-heavy morphology, part numbers/SKUs) is impossible today without indexing tricks on the user's side.Proposed direction
reverse) to make suffix lookups cheap, opt-in per field to avoid the memory cost.*term,te*rm) in the query, expanded against the radix tree.Notes / trade-offs
Related
Part of a competitive feature-gap review vs Fuse.js, MiniSearch, FlexSearch, Lunr.