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 /// Number of probes for IVF index
52 #[serde(rename = "nprobes", skip_serializing_if = "Option::is_none")]
53 pub nprobes: Option<i32>,
54 /// Number of results to skip
55 #[serde(rename = "offset", skip_serializing_if = "Option::is_none")]
56 pub offset: Option<i32>,
57 /// Whether to apply filtering before vector search
58 #[serde(rename = "prefilter", skip_serializing_if = "Option::is_none")]
59 pub prefilter: Option<bool>,
60 /// Refine factor for search
61 #[serde(rename = "refine_factor", skip_serializing_if = "Option::is_none")]
62 pub refine_factor: Option<i32>,
63 /// Upper bound for search
64 #[serde(rename = "upper_bound", skip_serializing_if = "Option::is_none")]
65 pub upper_bound: Option<f32>,
66 #[serde(rename = "vector")]
67 pub vector: Box<models::QueryTableRequestVector>,
68 /// 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.
69 #[serde(rename = "vector_column", skip_serializing_if = "Option::is_none")]
70 pub vector_column: Option<String>,
71 /// Table version to query
72 #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
73 pub version: Option<i64>,
74 /// If true, return the row id as a column called `_rowid`
75 #[serde(rename = "with_row_id", skip_serializing_if = "Option::is_none")]
76 pub with_row_id: Option<bool>,
77}
78
79impl QueryTableRequest {
80 pub fn new(k: i32, vector: models::QueryTableRequestVector) -> QueryTableRequest {
81 QueryTableRequest {
82 identity: None,
83 context: None,
84 id: None,
85 branch: None,
86 bypass_vector_index: None,
87 columns: None,
88 distance_type: None,
89 ef: None,
90 fast_search: None,
91 filter: None,
92 full_text_query: None,
93 k,
94 lower_bound: None,
95 nprobes: None,
96 offset: None,
97 prefilter: None,
98 refine_factor: None,
99 upper_bound: None,
100 vector: Box::new(vector),
101 vector_column: None,
102 version: None,
103 with_row_id: None,
104 }
105 }
106}
107