velesdb-core 1.7.2

High-performance vector database engine written in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Search result types for native HNSW.

/// Result of a nearest neighbor search.
#[derive(Debug, Clone, PartialEq)]
pub struct SearchResult {
    /// Node ID in the index
    pub id: usize,
    /// Distance from query
    pub distance: f32,
}

impl SearchResult {
    /// Creates a new search result.
    #[must_use]
    pub fn new(id: usize, distance: f32) -> Self {
        Self { id, distance }
    }
}