Skip to main content

Module index

Module index 

Source
Expand description

The in-memory candidate index: trigram -> set of file IDs, plus a file table.

This is the “narrow the candidate set” half of rgx. Building, querying, incremental update, and persistence are kept separable from the walk and from ripgrep so each can be tested in isolation.

Incremental updates are deliberately simple and lean on the confirm step for correctness: when a file changes we add its current trigrams (so no new-trigram query can miss it); trigrams that the file no longer contains linger in their posting lists, which only ever produces an extra candidate that ripgrep then filters out. Deleted files are tombstoned (live = false) so they stop being candidates. See docs/index-and-storage.md sections 3.1 and 5.

Structs§

Index

Functions§

walk_builder
A WalkBuilder that enumerates exactly the files rg would under root. The crate defaults already match ripgrep (skip hidden; honor .gitignore/.ignore/.git/info/exclude and the global gitignore; read parent ignores; don’t follow symlinks); the one thing the rg binary adds on top of the crate is the .rgignore custom ignore name. Both the index walk and the full_scan fallback go through here so they can’t drift from rg — or from each other. See docs/indexing.md (What the walk includes).
walk_files
Collect the files ripgrep would search under root, sorted so file IDs are deterministic.