Repository navigation
feat(ingest): keep BM25 index in its dataset - #557
Merged
Merged
Conversation
BM25 indexes lived under index/bm25/v<N> for the shared corpus and notebooks/<slug>/index/bm25/v<N> per notebook. A corpus_version is only unique within its dataset, so a root shared across datasets could serve one dataset's index for another's version, and a notebook cutover swapped the chunks while leaving their BM25 index behind. The root is now <lancedb>/derived/bm25 for every dataset. Config and ApplicationPaths derive it from the dataset unless ARXMCP_BM25_INDEX_ROOT is set; build_bm25_index and the server's auto-build default to it through resolve_bm25_root. The global BM25_INDEX_ROOT, and the test hook that patched it, are gone: each test dataset now carries its own index. Upgrade: indexes under the old roots are no longer read. The server rebuilds the missing version on its next start. Closes #554
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.
What
Moves every BM25 root to
<lancedb>/derived/bm25. Before, the shared root wasindex/bm25and each notebook's wasnotebooks/<slug>/index/bm25. Acorpus_versionis unique only within its dataset, so the new layout makes the shared-v49 versus notebook-v49 collision impossible. Cutover and rollback now move the index with its chunks. This is phase 2 of #551.Closes #554
Verification
ruff check .is clean.mainand pass here:derived/bm25/v<N>directory swaps on cutover and is restored on rollback.pyteston Linux has 1 failure,test_symlink_loop_is_rejected, which also fails onmain(Python 3.13). No BM25 artifacts appear under the repo'svar/after the run, so removing the conftest hook leaks nothing.Notes
BM25_INDEX_ROOTand its autouse conftest hook. Each test dataset now carries its own index, so the hook had nothing left to isolate.test_cutover_builds_no_global_bm25: the global root it guarded no longer exists.index/bm25andnotebooks/*/index/bm25directories can be deleted by hand.Generated by Claude Code