Repository navigation
v.1.6.0 Feat&refactor: Multi-Field Search, Segments, and Benchmarks
Release Highlights
This release significantly expands fts-engine from a simpler legacy full-text engine into a more complete Go search library with multi-field search, richer query execution, explicit persistence modes, built-in diagnostics, and a dedicated benchmark suite.
New
Expanded search API
fts-engine now supports a broader set of search patterns:
- query-string search
- plain-text bag-of-words search via
SearchPlainText(...) - field-scoped search
- phrase search
- phrase-near search
- prefix search
- grouped boolean queries
- field-specific clause execution via
SearchFieldClauses(...)
For applications that need stronger control than raw query strings, programmatic query ASTs are also available.
Multi-field indexing and search
The library now supports multi-field services through fts.NewMultiField(...).
This enables:
- one index per field
- lazy field index creation
- cross-field search
- field-restricted queries
- cleaner handling of documents with structured searchable fields
Single-field mode still exists, but is now more clearly defined around the_defaultfield.
Ranking and execution improvements
This release adds score-based ranking with:
BM25TF-IDF
It also improves query execution for more advanced workloads, including optimized boolean/scored search paths and improved handling of top-k retrieval.
Diagnostics and observability
Search diagnostics are now available as an opt-in per-request feature.
Consumers can inspect:
- logical query type
- execution strategy
- typed timings
- internal counters
For aggregated observability across many requests, the newpkg/ftsstatspackage provides reusable search statistics collection.
Highlighting
The engine now includes query-aware highlighting utilities for both:
- parsed query-string search
- plain-text search
This makes it easier to render snippets or marked fragments in client UIs and demos.
Persistence overhaul
Persistence has been reworked into a more explicit public API in pkg/ftspersist.
Two persistence modes are now documented and supported:
snapshot: saves and restores a mutable servicesegment: saves and restores a sealed read-only service
Additional improvements include:- multi-field persistence support
- persisted collection stats, registry, and tombstones
- lower-level segment access through
pkg/segment mmapsupport for segment loading
This makes the difference between mutable restore flows and read-only optimized restore flows much clearer.
Separate benchmark suite
A new standalone benchmark subproject has been added under benchmarks/.
It provides cross-engine comparisons for:
fts-engineblevebluge
Supported datasets:syntheticfor deterministic throughput/latency runsmsmarcofor realistic natural-language quality evaluationwiki-typedfor typed query-class benchmarking on real data
The suite also adds:- JSON reports
- shard aggregation
- automation scripts
- dataset fetch/generation helpers
- reusable adapters and harnesses
The current documented baseline is: -concurrency=1fts-engine -persist=snapshot
The older benchmark path in the repository still exists, butbenchmarks/is now the newer benchmark layer.
Changed
Clearer public surface
The README now explicitly positions the main consumer-facing packages as:
pkg/ftspkg/index/slicedradixpkg/index/hamtpkg/keygenpkg/ftspersistpkg/segmentpkg/textprocpkg/ftspresetpkg/filterpkg/ftsstats
Repository-local tooling such ascmd/*,internal/*, andbenchmarks/*is documented separately from the main library API.
Updated examples and docs
Examples were refreshed to match the new search and persistence flows, including:
- snapshot save/load
- segment save/load
- low-level segment loading
- mmap-based segment loading
Documentation now better reflects the intended usage model for both library consumers and repository tooling users.
Removed / Breaking Changes
- The legacy single-field indexing API has been removed.
- Older legacy public index packages such as
pkg/index/radixandpkg/index/hamtpointeredwere removed. fts.New(...)should now be treated as a_default-field single-field service.- Arbitrary field indexing/search should move to
fts.NewMultiField(...). - Snapshot and segment formats are different and are not interchangeable.
- Consumers should prefer
pkg/ftspersistover older persistence entry points.
Migration Notes
If you are upgrading from the master baseline:
- replace legacy single-field document indexing calls with the current
fts.Document-based API - use
fts.NewMultiField(...)if your documents contain multiple searchable fields - move persistence integrations to
pkg/ftspersist - use segment persistence when you want sealed read-only restore flows
- use snapshot persistence when you need mutable restore flows after load
- review removed legacy index package imports and switch to supported built-in indexes