English | 中文
SaFtsearch is an experimental desktop file search application built with Rust and Python.
Project status: under active development. The repository currently contains the basic framework, early CLI search logic, a first desktop UI shell, and learning documents. APIs, commands, configuration fields, and desktop integration may still change.
- Provide fast local file search on desktop systems.
- Use Rust for scanning, indexing, query scoring, and performance-sensitive work.
- Use Python for desktop UI, configuration, process orchestration, and user-facing workflows.
- Keep the search core independent so it can be tested and reused by both CLI and GUI layers.
flowchart LR
User["User"] --> UI["Python Desktop App"]
UI --> IPC["JSON / stdio / local IPC"]
IPC --> Core["Rust Search Core"]
Core --> Scanner["File Scanner"]
Core --> Query["Query and Ranking"]
Scanner --> Feature["File Feature Extraction"]
Query --> Result["Search Results"]
- Rust workspace and search-core crate.
- Basic file feature model.
- Directory scanning with exclusion patterns.
- Filename search with simple scoring.
- JSON output for scan and search results.
- Python desktop UI shell with search input, result table, folder selection, and basic result actions.
- Python service layer that calls the Rust CLI and parses
SearchHitJSON.
SaFtsearch/
Cargo.toml
pyproject.toml
config/
default.toml
crates/
search-core/
Cargo.toml
src/
lib.rs
main.rs
protocol.rs
query.rs
scanner.rs
python-app/
src/
saftsearch_app/
__init__.py
config.py
core_client.py
main.py
main_window.py
search_service.py
tests/
test_core_client.py
docs/
Run Rust checks and tests:
cargo check
cargo testPrint the default Rust-side configuration:
cargo run --bin saftsearch-indexer -- configScan files in the current project:
cargo run --bin saftsearch-indexer -- scan . --exclude target --exclude .gitSearch by filename:
cargo run --bin saftsearch-indexer -- search toml . --limit 10 --exclude target --exclude .gitInstall the Python desktop dependencies:
python -m pip install -e .[desktop]Run the Python desktop UI:
python -m saftsearch_app.main- Build a minimal runnable Rust CLI for scanning and filename search.
- Connect the Python desktop layer to the Rust search process.
- Add persistent indexing to avoid full rescans on every query.
- Add filesystem watching for incremental updates.
- Improve ranking, filtering, and desktop interactions.
- Add full-text indexing after the filename search path is stable.
This project is not production-ready yet. The current code is intended to make the architecture runnable and testable while the search engine, index storage, and desktop UI are developed step by step.