Skip to main content

qdrant_edge/edge/requests/
count.rs

1use crate::segment::types::Filter;
2
3/// Count request — counts the number of points which match the given conditions.
4/// If no filter is provided, the count of all points in the shard is returned.
5#[derive(Clone, Debug, PartialEq)]
6pub struct CountRequest {
7    /// Look only for points which satisfy these conditions.
8    pub filter: Option<Filter>,
9    /// If true, count the exact number of points. If false, count the approximate number of
10    /// points faster. The approximate count might be unreliable while segments are being
11    /// optimized. Default: true.
12    pub exact: bool,
13}
14
15impl CountRequest {
16    pub fn new() -> Self {
17        Self {
18            filter: None,
19            exact: true,
20        }
21    }
22}
23
24impl Default for CountRequest {
25    fn default() -> Self {
26        Self::new()
27    }
28}