Expand description
Composable indexed code search engine.
sift-core builds on-disk indexes over codebases and uses them to narrow
candidate files before running the full regex engine. The index layer is
designed for multiple coexisting index types: each type independently
narrows candidates, and the Indexes registry intersects their results.
Today the shipped index type is a trigram index (TrigramIndex), which
records overlapping 3-byte sequences and achieves up to 60x speedup over
ripgrep on indexed queries. Additional index types (AST indexes, dependency
graphs, vector indexes) can be added by extending the IndexKind and
Index enums.
§Architecture
IndexStore::build(kinds) -> snapshot with index artifacts
Indexes::open(sift_dir) -> registry of opened indexes
QueryPlanner::candidates -> intersect index candidate sets
SearchQuery::run -> regex scan over narrowed candidatesWalking: WalkBuilder from the ignore crate.
Re-exports§
pub use grep::GrepRun;pub use candidate::Candidate;pub use search::SearchError;pub use search::SearchOutcome;pub use search::SearchQuery;pub use query::CandidateRequirement;pub use query::QueryFlags;pub use query::QueryPlanner;pub use query::QuerySpec;pub use query::UnindexedStrategy;
Modules§
- candidate
- grep
- Grep pipeline orchestration.
- query
- search
- Indexed search execution built on the public grep crates.
Structs§
- Corpus
Meta - Which corpus this store indexes.
- Corpus
Spec - Description of a corpus to index.
- FileId
- Filter
Meta - Ignore and visibility rules in effect when the index was built.
- Index
Config - Configuration for building or updating an index over a corpus.
- IndexId
- Index
Store - Index lifecycle orchestrator backed by a [
SnapshotStore] for atomic persistence and coordination. - Index
Walk Config - Filesystem walk behavior for index builds and updates.
- Indexes
- Registry of opened indexes read from a snapshot store.
- Query
Plan Output - Store
Meta - Persistent store manifest (
.sift/meta.json). - Trigram
Index - Opened trigram index with memory-mapped posting lists.
- Walk
- Walk is a recursive directory iterator over file paths in one or more directories.
- Walk
Builder - WalkBuilder builds a recursive directory iterator.
- Walk
Meta - Filesystem walk behavior used when the index was built.
Enums§
- Corpus
Kind - Whether the index was built from a directory or a single file.
- Error
- Top-level umbrella error for all core operations.
- Index
- An opened index instance, used for query-time candidate narrowing.
- Index
Error - Errors specific to the index registry layer.
- Index
Kind - Tag identifying an index kind for lifecycle dispatch (build, open, update).
- Plan
Mode - How an index query plan resolves candidates.
- Trigram
Index Error - Errors specific to opening or persisting a trigram index.