Skip to main content

hora_graph_core/search/
mod.rs

1//! Search subsystem — vector (SIMD cosine), BM25+, and hybrid RRF fusion.
2
3pub mod bm25;
4pub mod hybrid;
5pub mod vector;
6
7use crate::core::types::EntityId;
8
9/// A search result: entity ID + similarity score.
10#[derive(Debug, Clone, PartialEq)]
11#[must_use]
12pub struct SearchHit {
13    /// ID of the matching entity.
14    pub entity_id: EntityId,
15    /// Relevance score (higher is better; scale depends on the search method).
16    pub score: f32,
17}
18
19/// Options for hybrid search.
20#[derive(Debug, Clone)]
21pub struct SearchOpts {
22    /// Maximum number of results to return.
23    pub top_k: usize,
24    /// Include dark nodes in results (for future ACT-R integration).
25    pub include_dark: bool,
26}
27
28impl Default for SearchOpts {
29    fn default() -> Self {
30        Self {
31            top_k: 10,
32            include_dark: false,
33        }
34    }
35}