trieve_client/models/
sort_by_field.rs

1/*
2 * Trieve API
3 *
4 * Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5 *
6 * The version of the OpenAPI document: 0.11.7
7 * Contact: developers@trieve.ai
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct SortByField {
15    #[serde(rename = "direction", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
16    pub direction: Option<Option<models::SortOrder>>,
17    /// Field to sort by. This has to be a numeric field with a Qdrant `Range` index on it. i.e. num_value and timestamp
18    #[serde(rename = "field")]
19    pub field: String,
20    /// How many results to pull in before the sort
21    #[serde(rename = "prefetch_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub prefetch_amount: Option<Option<i64>>,
23}
24
25impl SortByField {
26    pub fn new(field: String) -> SortByField {
27        SortByField {
28            direction: None,
29            field,
30            prefetch_amount: None,
31        }
32    }
33}
34