Repository navigation
feat(ingest): build derived indexes into staging - #558
Merged
Merged
Conversation
The producers of a staged dataset wrote chunks only. Its BM25, definitions and theorem-name indexes were built later, if at all, so a cutover could promote chunks that nothing indexed. ingest.derived_indexes.build_derived_indexes builds all three inside the dataset for the version in its marker. run_bulk_ingest calls it once a paper has landed, run_re_embed before it marks the staging run complete, and run_delta before it advances its harvest state. Because the indexes now live in the dataset, ops/cutover.py and tools/notebook_cutover.py promote and roll them back with the chunks without knowing they exist. notebook_ingest drops its own index builds, which run_bulk_ingest now makes. python -m ingest.derived_indexes rebuilds them by hand. The equations table is still produced by extraction, not here. Closes #555 Closes #310 Closes #551
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
Every producer of a staged dataset now builds the dataset's BM25, definitions and theorem-name indexes inside it before it reports the dataset ready:
run_bulk_ingestrun_re_embedcompletesentinelrun_deltaThe two cutover scripts promote and roll back the indexes together with the chunks, without knowing the indexes exist. This is phase 3 of #551, which it completes.
Closes #555
Closes #310
Closes #551
Verification
ruff check .is clean.tests/test_derived_indexes.py:ops/cutover.pyleaves the live dataset's indexes byte-identical to before, and the server config still points at them.in_progress;last_successful_run_utcis written.pyteston Linux has 1 failure,test_symlink_loop_is_rejected, which also fails onmain(Python 3.13).Notes
tools/notebook_ingest.pyno longer builds indexes itself, becauserun_bulk_ingestdoes. The tests that stubbed the old per-index calls moved totest_derived_indexes.py, which replacestest_notebook_ingest.py.python -m ingest.derived_indexes <lancedb>rebuilds the indexes by hand.in_progress, so cutover refuses to promote.Generated by Claude Code