qdrant_edge/edge/requests/matrix.rs
1use crate::segment::types::{Filter, VectorNameBuf};
2
3/// A single-shard distance-matrix request: sample `sample_size` random points that
4/// carry the `using` vector, then find each sample's `limit_per_sample` nearest
5/// neighbours restricted to the sampled set.
6#[derive(Clone, Debug, PartialEq)]
7pub struct SearchMatrixRequest {
8 /// How many random points to sample.
9 pub sample_size: usize,
10 /// How many nearest neighbours to return per sampled point.
11 pub limit_per_sample: usize,
12 /// Look only for points which satisfy these conditions.
13 pub filter: Option<Filter>,
14 /// Name of the vector the sampled points are compared by.
15 pub using: VectorNameBuf,
16}
17
18impl SearchMatrixRequest {
19 pub fn new(sample_size: usize, limit_per_sample: usize, using: VectorNameBuf) -> Self {
20 Self {
21 sample_size,
22 limit_per_sample,
23 filter: None,
24 using,
25 }
26 }
27}