1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! Vector engine operations dispatched to the Data Plane.
use std::sync::Arc;
/// Vector engine physical operations.
#[derive(Debug, Clone)]
pub enum VectorOp {
/// Vector similarity search.
Search {
collection: String,
query_vector: Arc<[f32]>,
top_k: usize,
/// Optional search beam width override. If 0, uses default `4 * top_k`.
ef_search: usize,
/// Pre-computed bitmap of eligible document IDs (from filter evaluation).
filter_bitmap: Option<Arc<[u8]>>,
/// Named vector field to search. Empty string = default field.
field_name: String,
/// RLS post-candidate filters (serialized `Vec<ScanFilter>`).
/// Applied after HNSW returns candidates, before returning to client.
/// Result count may be less than requested `top_k`.
rls_filters: Vec<u8>,
},
/// Insert a vector into the HNSW index (write path).
Insert {
collection: String,
vector: Vec<f32>,
dim: usize,
/// Named vector field. Empty string = default (unnamed) field.
field_name: String,
/// Optional document ID to associate with this vector.
doc_id: Option<String>,
},
/// Batch insert vectors into the HNSW index.
BatchInsert {
collection: String,
vectors: Vec<Vec<f32>>,
dim: usize,
},
/// Multi-vector search: query across all named vector fields, fuse via RRF.
MultiSearch {
collection: String,
query_vector: Arc<[f32]>,
top_k: usize,
ef_search: usize,
filter_bitmap: Option<Arc<[u8]>>,
/// RLS post-candidate filters.
rls_filters: Vec<u8>,
},
/// Soft-delete a vector by internal node ID.
Delete { collection: String, vector_id: u32 },
/// Set vector index parameters for a collection.
SetParams {
collection: String,
m: usize,
ef_construction: usize,
metric: String,
/// Index type: "hnsw" (default), "hnsw_pq", or "ivf_pq".
index_type: String,
/// PQ subvectors (for hnsw_pq and ivf_pq). Default: 8.
pq_m: usize,
/// IVF cells (for ivf_pq only). Default: 256.
ivf_cells: usize,
/// IVF probe count (for ivf_pq only). Default: 16.
ivf_nprobe: usize,
},
}