qdrant_edge/edge/builders/
edge_sparse_vector_params.rs1use crate::segment::data_types::modifier::Modifier;
7use crate::segment::types::VectorStorageDatatype;
8
9use crate::edge::config::vectors::EdgeSparseVectorParams;
10
11#[derive(Debug, Clone, Default)]
16pub struct EdgeSparseVectorParamsBuilder {
17 full_scan_threshold: Option<usize>,
18 on_disk: Option<bool>,
19 modifier: Option<Modifier>,
20 datatype: Option<VectorStorageDatatype>,
21}
22
23impl EdgeSparseVectorParamsBuilder {
24 pub fn new() -> Self {
25 Self::default()
26 }
27
28 pub fn full_scan_threshold(mut self, full_scan_threshold: usize) -> Self {
29 self.full_scan_threshold = Some(full_scan_threshold);
30 self
31 }
32
33 pub fn on_disk(mut self, on_disk: bool) -> Self {
35 self.on_disk = Some(on_disk);
36 self
37 }
38
39 pub fn modifier(mut self, modifier: Modifier) -> Self {
40 self.modifier = Some(modifier);
41 self
42 }
43
44 pub fn datatype(mut self, datatype: VectorStorageDatatype) -> Self {
45 self.datatype = Some(datatype);
46 self
47 }
48
49 pub fn build(self) -> EdgeSparseVectorParams {
50 let Self {
53 full_scan_threshold,
54 on_disk,
55 modifier,
56 datatype,
57 } = self;
58 EdgeSparseVectorParams {
59 full_scan_threshold,
60 on_disk,
61 modifier,
62 datatype,
63 }
64 }
65}