Skip to content

v.1.6.0 Feat&refactor: Multi-Field Search, Segments, and Benchmarks

Choose a tag to compare

@dariasmyr dariasmyr released this 14 Jun 11:42
· 51 commits to master since this release
d427eee

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 _default field.

Ranking and execution improvements

This release adds score-based ranking with:

  • BM25
  • TF-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 new pkg/ftsstats package 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 service
  • segment: 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
  • mmap support 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-engine
  • bleve
  • bluge
    Supported datasets:
  • synthetic for deterministic throughput/latency runs
  • msmarco for realistic natural-language quality evaluation
  • wiki-typed for 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=1
  • fts-engine -persist=snapshot
    The older benchmark path in the repository still exists, but benchmarks/ is now the newer benchmark layer.

Changed

Clearer public surface

The README now explicitly positions the main consumer-facing packages as:

  • pkg/fts
  • pkg/index/slicedradix
  • pkg/index/hamt
  • pkg/keygen
  • pkg/ftspersist
  • pkg/segment
  • pkg/textproc
  • pkg/ftspreset
  • pkg/filter
  • pkg/ftsstats
    Repository-local tooling such as cmd/*, internal/*, and benchmarks/* 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/radix and pkg/index/hamtpointered were 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/ftspersist over 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