vector-store: introduce fts index module with document counting#462
Open
knowack1 wants to merge 4 commits into
Open
vector-store: introduce fts index module with document counting#462knowack1 wants to merge 4 commits into
knowack1 wants to merge 4 commits into
Conversation
06f71bb to
3728664
Compare
84cf87f to
be774ee
Compare
There was a problem hiding this comment.
Pull request overview
Introduces an FTS (full-text-search) index module alongside the existing vector-search index, and adds an Index enum dispatcher so call sites explicitly handle both variants. The previous index/ module is renamed to vs_index/ (with enum Index → VsIndex) for naming symmetry with the new fts_index/.
Changes:
- New
fts_indexactor module providingFtsIndexmessages, anFtsIndexExttrait, and a minimal in-memory document counter; FTS branch wired intoengine::add_index,monitor_items, and HTTP status/metrics routes. - New
Indexenum insrc/index.rs(Vs(Sender<VsIndex>)/Fts(Sender<FtsIndex>)) withFromimpls;IndexEntryand engineget_indexnow return/storeIndexrather than a raw vector-search sender. - Module rename
index/→vs_index/(enum renamed toVsIndex), with all imports and exports updated, plus a new integration testtests/integration/fts.rsandscan_fn_documentshelper.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/vector-store/src/fts_index/mod.rs | New FTS actor with add/remove/count messages and naive in-memory counter. |
| crates/vector-store/src/index.rs | New Index enum wrapping VS/FTS senders with From conversions. |
| crates/vector-store/src/engine.rs | Removes FTS not-implemented guard; adds create_index dispatch on IndexKind. |
| crates/vector-store/src/monitor_items.rs | Routes add/remove/partition operations per index variant; updated tests. |
| crates/vector-store/src/httproutes.rs | Calls count and ANN against the new Index enum; rejects ANN for FTS. |
| crates/vector-store/src/indexes.rs | IndexEntry now holds Index and returns it by reference. |
| crates/vector-store/src/lib.rs | Adds fts_index/vs_index modules and re-exports IndexFactory from vs_index. |
| crates/vector-store/src/vs_index/{mod,actor,factory,usearch,opensearch,validator}.rs | Mechanical rename of index/ → vs_index/ and Index → VsIndex. |
| crates/vector-store/tests/integration/fts.rs | New integration test asserting FTS index becomes Serving with count == 2. |
| crates/vector-store/tests/integration/db_basic.rs | Factors scan_fn via make_scan_fn; adds scan_fn_documents; maps IndexKind to DbIndexKind. |
| crates/vector-store/tests/integration/main.rs | Registers the new fts integration test module. |
Comments suppressed due to low confidence (1)
crates/vector-store/src/vs_index/actor.rs:80
- Naming inconsistency: the actor enum was renamed from
IndextoVsIndex, and the new FTS module exposesFtsIndex+FtsIndexExt, but the corresponding vector-search trait is still calledIndexExt(re-exported asvs_index::IndexExt). For symmetry withFtsIndexExtand to match the renamed enum, consider renaming this trait toVsIndexExt.
ewienik
requested changes
Jun 2, 2026
ewienik
left a comment
Collaborator
There was a problem hiding this comment.
Consider splitting the first commit into such commits:
- move index dir into vs_index (to preserve git history)
- refactor vs_index names
- create fts_index module (and inside mod.rs, actor.rs, factory.rs and tantivy.rs - similary to the vs_index module; in the future we could have other implementation of fts index)
def35b7 to
75c3f23
Compare
75c3f23 to
28e4f83
Compare
Collaborator
Author
|
@ewienik All comments has been addressed, please re-review latest changes. |
Rename the index/ directory to vs_index/ to make room for a parallel full-text-search index module. This commit only moves the files and updates the module path so git records the rename and preserves history; type names are left unchanged and refactored in a follow-up commit.
Rename the vector-search index types so they carry a Vs prefix, mirroring the naming used for the upcoming full-text-search module: - Index -> VsIndex - IndexExt -> VsIndexExt - IndexFactory -> VsIndexFactory - IndexConfiguration -> VsIndexConfiguration This keeps both index implementations following a consistent naming convention.
- Add fts_index module with FtsIndex actor, FtsIndexExt, and TantivyIndexFactory - Introduce IndexDispatch trait in monitor_items for generic index dispatch - Make monitor_items::new generic over IndexDispatch (VsIndex, FtsIndex) - Split engine add_index into add_index_vs and add_index_fts via AddIndexContext - Extend Indexes to store FTS entries alongside VS entries - Update httproutes for FTS index status and count
The FTS actor now tracks document count: AddDocument increments, RemoveDocument decrements (saturating), RemovePartition resets to zero, and Count responds with the current value. An integration test asserts that the FTS index correctly counts documents ingested during fullscan. The db_basic mock is fixed to derive DbIndexKind from IndexMetadata.kind and handle GetIndexParams for non-VS indexes.
28e4f83 to
caab5d3
Compare
Collaborator
Author
Done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the full-text-search (FTS) index infrastructure alongside the existing vector-search index. The core change is a new
Indexenum that dispatches operations to either aVsIndexorFtsIndexactor through their respectivempsc::Senderchannels. Callers match on the enum variant directly rather than going through an adapter with methods, keeping the dispatch explicit at each call site.The previous
index/directory is renamed tovs_index/and its actor enum is renamed fromIndextoVsIndexso both index types follow a consistent naming convention. A newfts_indexmodule provides theFtsIndexactor with document add/remove/count operations and an extension trait (FtsIndexExt) mirroring the existingIndexExtpattern.VECTOR-621