seekr_code/index/mod.rs
1//! Index engine module.
2//!
3//! Manages HNSW vector index for semantic search and inverted text index
4//! for keyword search. Supports mmap-based zero-copy loading and
5//! incremental updates.
6
7pub mod incremental;
8pub mod mmap_store;
9pub mod store;
10
11/// An entry in the search index.
12#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
13pub struct IndexEntry {
14 /// Unique chunk ID corresponding to a CodeChunk.
15 pub chunk_id: u64,
16
17 /// Embedding vector.
18 pub embedding: Vec<f32>,
19
20 /// Tokenized text for inverted index.
21 pub text_tokens: Vec<String>,
22}
23
24/// A search result from the index.
25#[derive(Debug, Clone)]
26pub struct SearchHit {
27 /// Chunk ID of the matched entry.
28 pub chunk_id: u64,
29
30 /// Relevance score.
31 pub score: f32,
32}