Skip to main content

Crate srcsearch

Crate srcsearch 

Source
Expand description

§srcsearch

srcsearch indexes Rust source and Markdown documentation, and supports full-text lookup over indexed content through Tantivy.

§Typical workflow

  1. Build records with index_project (or index_target for incremental work).
  2. Persist results via write_json or write_tantivy_index.
  3. Query with search_tantivy_index_with_explain (pass false for explanations when you only need hits).

See the project README for CLI examples and end-to-end usage.

Structs§

SearchHit
SearchHitWithExplanation

Enums§

SearchRecord
SearchScope

Functions§

collect_files
Collects Rust and Markdown files under a project root while honoring ignore rules.
get_tantivy_doc_field
Looks up a required Tantivy field by name and returns a contextual error if missing.
index_project
Indexes an entire project directory relative to itself.
index_target
Indexes either a single file or directory and normalizes file paths relative to project_root.
search_tantivy_index
search_tantivy_index_with_explain
Executes search and optionally attaches Tantivy score explanations for the top results.
update_tantivy_index
Updates an existing Tantivy index by deleting changed files and re-adding their current records.
write_json
Writes indexed records as pretty JSON using a temporary file for atomic replacement.
write_tantivy_index
Creates a new Tantivy index directory and writes all provided records into it.

Type Aliases§

AppResult