Skip to main content

qdrant_edge/edge/requests/
scroll.rs

1use crate::segment::data_types::load_profile::LoadProfile;
2use crate::segment::data_types::order_by::OrderByInterface;
3use crate::segment::types::{Filter, PointIdType, WithPayloadInterface, WithVector};
4use crate::shard::scroll::ScrollRequestInternal;
5
6/// Scroll request — paginate over all points which match the given conditions.
7#[derive(Clone, Debug, PartialEq)]
8pub struct ScrollRequest {
9    /// Start ID to read points from.
10    pub offset: Option<PointIdType>,
11    /// Page size. Default: 10.
12    pub limit: Option<usize>,
13    /// Look only for points which satisfy these conditions. If not provided — all points.
14    pub filter: Option<Filter>,
15    /// Select which payload to return with the response. Default is true.
16    pub with_payload: Option<WithPayloadInterface>,
17    /// Options for specifying which vectors to include into the response. Default is false.
18    pub with_vector: WithVector,
19    /// Order the records by a payload field instead of by id.
20    pub order_by: Option<OrderByInterface>,
21}
22
23impl ScrollRequest {
24    pub fn new() -> Self {
25        Self {
26            offset: None,
27            limit: None,
28            filter: None,
29            with_payload: None,
30            with_vector: WithVector::Bool(false),
31            order_by: None,
32        }
33    }
34
35    /// Request-specific [`LoadProfile`] for opening a read-only shard to serve exactly
36    /// this scroll: no vector components are warmed, and only the field indexes the
37    /// filter and `order_by` read keep their configured placement.
38    pub fn load_profile(&self) -> LoadProfile {
39        ScrollRequestInternal::from(self.clone()).load_profile()
40    }
41}
42
43impl Default for ScrollRequest {
44    fn default() -> Self {
45        Self::new()
46    }
47}