Expand description
ix — sub-millisecond code search via sparse trigram indexing.
ix pre-computes a byte-level trigram index to narrow search candidates
to a fraction of the total file set, then verifies matches with a
memory-constant streaming architecture. This eliminates the linear-scan
bottleneck of traditional tools on large codebases.
§Installation
cargo install moeix§Quick Start
ix --build /path/to/repo
ix "fn validate"
ix --regex "fn\\s+\\w+_handler" --context 3§Library Usage
ⓘ
use ix::{Reader, Executor};
let reader = Reader::open(".ix/shard.ix")?;
let mut executor = Executor::new(&reader);
let matches = executor.execute(query);§Module Build Order
format → varint → trigram → bloom → posting →
string_pool → builder → reader → planner → executor → scanner
Cache layer: posting_cache → neg_cache → regex_pool → cache_policy
§Feature Flags
notify(default) — File watcher + daemon (ixd) + Unix domain socket IPCdecompress— gz/zst/bz2/xz decompressionarchive— zip/tar archive supportfull— All optional features
Re-exports§
pub use crate::builder::Builder;pub use crate::daemon_sock::ClientMessage;pub use crate::daemon_sock::DaemonClient;pub use crate::daemon_sock::DaemonServer;pub use crate::daemon_sock::DaemonStatus;pub use crate::daemon_sock::FileChange;pub use crate::daemon_sock::FileOp;pub use crate::daemon_sock::ServerMessage;pub use crate::format::Beacon;pub use crate::idle::IdleTracker;pub use crate::watcher::Watcher;
Modules§
- archive
- Archive searching support (.zip, .tar.gz).
- bloom
- Per-file bloom filters.
- builder
- Index builder — the complete pipeline from files to .ix shard.
- cache_
policy - Adaptive cache policy driven by
ResourceGuardmemory pressure. Adaptive cache policy driven by llmosafe’sResourceGuardpressure signal. - config
- Configuration loading for ix.
- daemon_
sock - Unix domain socket interface for the ixd daemon.
- decompress
- Transparent decompression by file extension.
- error
- Error types for the ix crate.
- executor
- Query executor — search through the index and verify results.
- format
- Index file format constants and header parsing.
- idle
- Idle/dormancy detection for the daemon.
- neg_
cache - Negative result cache — skips re-verification of known non-matching files. Negative result cache.
- planner
- Query planner — transforms user input into an optimal index query plan.
- posting
- Posting list encode/decode (delta + varint + ZSTD compression).
- posting_
cache - LRU cache for decoded posting lists, keyed by trigram. LRU cache for decoded posting lists, keyed by trigram.
- reader
- Index reader — the mmap-based query-time interface.
- regex_
pool - Compiled regex pool — caches
Regexobjects to avoid recompilation. Compiled regex pool — cachesRegexobjects to avoid recompilation. - scanner
- Fallback scanner (no index, competitive with ripgrep).
- string_
pool - Path string pool with prefix deduplication.
- trigram
- Trigram extraction — the core indexing primitive.
- varint
- Protobuf-style varint encoding/decoding.
- watcher
- File system watcher (notify crate) with debouncing.
Functions§
- run_
daemon - Run the daemon watching the given directory for changes and rebuilding the index.