MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / attach_body

Method attach_body

nodedb/src/data/executor/handlers/vector_search_exec.rs:25–40  ·  view source on GitHub ↗
(
        &self,
        tid: u64,
        collection: &str,
        attach: bool,
        mut hit: super::super::response_codec::VectorSearchHit,
    )

Source from the content-addressed store, hash-verified

23 /// the client). When `attach == false` the hit is returned unchanged.
24 #[inline]
25 fn attach_body(
26 &self,
27 tid: u64,
28 collection: &str,
29 attach: bool,
30 mut hit: super::super::response_codec::VectorSearchHit,
31 ) -> super::super::response_codec::VectorSearchHit {
32 if !attach {
33 return hit;
34 }
35 let hex = format!("{:08x}", hit.id);
36 if let Ok(Some(bytes)) = self.sparse.get(tid, collection, &hex) {
37 hit.body = Some(bytes);
38 }
39 hit
40 }
41
42 pub(in crate::data::executor) fn execute_vector_search(
43 &mut self,

Callers 3

execute_vector_searchMethod · 0.80
search_ivfMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected