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)
| 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 | } |