lance_namespace_reqwest_client/models/query_table_request.rs
1/*
2 * Lance Namespace Specification
3 *
4 * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct QueryTableRequest {
16 #[serde(rename = "identity", skip_serializing_if = "Option::is_none")]
17 pub identity: Option<Box<models::Identity>>,
18 /// Arbitrary context as key-value pairs. How to use the context is custom to the specific implementation. On a request, it carries caller-provided context to the implementation. On a response, it carries implementation-provided context back to the caller. REST NAMESPACE ONLY Context entries are mapped to and from HTTP headers using the `header.` prefix: - On a request, any entry whose key starts with `header.` is sent as an HTTP request header with the prefix stripped. For example, the entry `{\"header.Authorization\": \"Bearer abc\"}` is sent as the request header `Authorization: Bearer abc`. - On a response, every HTTP response header is returned as an entry whose key is the header name prefixed with `header.`. For example, the response header `x-request-id: abc123` is returned as the entry `{\"header.x-request-id\": \"abc123\"}`.
19 #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
20 pub context: Option<std::collections::HashMap<String, String>>,
21 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
22 pub id: Option<Vec<String>>,
23 /// Branch to target. When not specified, the main branch is used.
24 #[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
25 pub branch: Option<String>,
26 /// Whether to bypass vector index
27 #[serde(rename = "bypass_vector_index", skip_serializing_if = "Option::is_none")]
28 pub bypass_vector_index: Option<bool>,
29 #[serde(rename = "columns", skip_serializing_if = "Option::is_none")]
30 pub columns: Option<Box<models::QueryTableRequestColumns>>,
31 /// Distance metric to use
32 #[serde(rename = "distance_type", skip_serializing_if = "Option::is_none")]
33 pub distance_type: Option<String>,
34 /// Search effort parameter for HNSW index
35 #[serde(rename = "ef", skip_serializing_if = "Option::is_none")]
36 pub ef: Option<i32>,
37 /// Whether to use fast search
38 #[serde(rename = "fast_search", skip_serializing_if = "Option::is_none")]
39 pub fast_search: Option<bool>,
40 /// Optional SQL filter expression. Field references in the expression must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled.
41 #[serde(rename = "filter", skip_serializing_if = "Option::is_none")]
42 pub filter: Option<String>,
43 #[serde(rename = "full_text_query", skip_serializing_if = "Option::is_none")]
44 pub full_text_query: Option<Box<models::QueryTableRequestFullTextQuery>>,
45 /// Number of results to return
46 #[serde(rename = "k")]
47 pub k: i32,
48 /// Lower bound for search
49 #[serde(rename = "lower_bound", skip_serializing_if = "Option::is_none")]
50 pub lower_bound: Option<f32>,
51 /// Maximum number of IVF partitions to search. When omitted, all partitions may be searched if needed.
52 #[serde(rename = "maximum_nprobes", skip_serializing_if = "Option::is_none")]
53 pub maximum_nprobes: Option<i32>,
54 /// Minimum number of IVF partitions to search before adaptive expansion.
55 #[serde(rename = "minimum_nprobes", skip_serializing_if = "Option::is_none")]
56 pub minimum_nprobes: Option<i32>,
57 /// Legacy exact number of IVF partitions to search. Ignored when minimum_nprobes or maximum_nprobes is provided.
58 #[serde(rename = "nprobes", skip_serializing_if = "Option::is_none")]
59 pub nprobes: Option<i32>,
60 /// Number of results to skip
61 #[serde(rename = "offset", skip_serializing_if = "Option::is_none")]
62 pub offset: Option<i32>,
63 /// Whether to apply filtering before vector search
64 #[serde(rename = "prefilter", skip_serializing_if = "Option::is_none")]
65 pub prefilter: Option<bool>,
66 /// Refine factor for search
67 #[serde(rename = "refine_factor", skip_serializing_if = "Option::is_none")]
68 pub refine_factor: Option<i32>,
69 /// Upper bound for search
70 #[serde(rename = "upper_bound", skip_serializing_if = "Option::is_none")]
71 pub upper_bound: Option<f32>,
72 #[serde(rename = "vector")]
73 pub vector: Box<models::QueryTableRequestVector>,
74 /// Lance field path of the vector field to search. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.
75 #[serde(rename = "vector_column", skip_serializing_if = "Option::is_none")]
76 pub vector_column: Option<String>,
77 /// Table version to query
78 #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
79 pub version: Option<i64>,
80 /// If true, return the row id as a column called `_rowid`
81 #[serde(rename = "with_row_id", skip_serializing_if = "Option::is_none")]
82 pub with_row_id: Option<bool>,
83}
84
85impl QueryTableRequest {
86 pub fn new(k: i32, vector: models::QueryTableRequestVector) -> QueryTableRequest {
87 QueryTableRequest {
88 identity: None,
89 context: None,
90 id: None,
91 branch: None,
92 bypass_vector_index: None,
93 columns: None,
94 distance_type: None,
95 ef: None,
96 fast_search: None,
97 filter: None,
98 full_text_query: None,
99 k,
100 lower_bound: None,
101 maximum_nprobes: None,
102 minimum_nprobes: None,
103 nprobes: None,
104 offset: None,
105 prefilter: None,
106 refine_factor: None,
107 upper_bound: None,
108 vector: Box::new(vector),
109 vector_column: None,
110 version: None,
111 with_row_id: None,
112 }
113 }
114}
115