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

Method build_codec_dispatch

nodedb-vector/src/collection/codec_build.rs:54–63  ·  view source on GitHub ↗

Build a codec-dispatched index over all current vectors using the requested quantization. Replaces any existing dispatch index for this collection. Idempotent. Returns a reference to the new index, or `None` if the quantization tag is not supported (falls back to per-segment Sq8/PQ paths) or there are no vectors to train on.

(&mut self, quantization: &str)

Source from the content-addressed store, hash-verified

52 /// tag is not supported (falls back to per-segment Sq8/PQ paths) or there
53 /// are no vectors to train on.
54 pub fn build_codec_dispatch(&mut self, quantization: &str) -> Option<&CollectionCodec> {
55 let vectors = self.gather_all_vectors_fp32();
56 let dim = self.dim;
57 let m = self.params.m;
58 let ef_construction = self.params.ef_construction;
59 let seed = 42_u64;
60 self.codec_dispatch =
61 build_collection_codec(quantization, &vectors, dim, m, ef_construction, seed);
62 self.codec_dispatch.as_ref()
63 }
64}

Calls 3

build_collection_codecFunction · 0.85
as_refMethod · 0.45