/*
* Lance Namespace Specification
*
* 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.
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AnalyzeTableQueryPlanRequest {
#[serde(rename = "identity", skip_serializing_if = "Option::is_none")]
pub identity: Option<Box<models::Identity>>,
/// 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\"}`.
#[serde(rename = "context", skip_serializing_if = "Option::is_none")]
pub context: Option<std::collections::HashMap<String, String>>,
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<Vec<String>>,
/// Branch to target. When not specified, the main branch is used.
#[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
pub branch: Option<String>,
/// Whether to bypass vector index
#[serde(rename = "bypass_vector_index", skip_serializing_if = "Option::is_none")]
pub bypass_vector_index: Option<bool>,
#[serde(rename = "columns", skip_serializing_if = "Option::is_none")]
pub columns: Option<Box<models::QueryTableRequestColumns>>,
/// Distance metric to use
#[serde(rename = "distance_type", skip_serializing_if = "Option::is_none")]
pub distance_type: Option<String>,
/// Search effort parameter for HNSW index
#[serde(rename = "ef", skip_serializing_if = "Option::is_none")]
pub ef: Option<i32>,
/// Whether to use fast search
#[serde(rename = "fast_search", skip_serializing_if = "Option::is_none")]
pub fast_search: Option<bool>,
/// 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.
#[serde(rename = "filter", skip_serializing_if = "Option::is_none")]
pub filter: Option<String>,
#[serde(rename = "full_text_query", skip_serializing_if = "Option::is_none")]
pub full_text_query: Option<Box<models::QueryTableRequestFullTextQuery>>,
/// Number of results to return
#[serde(rename = "k")]
pub k: i32,
/// Lower bound for search
#[serde(rename = "lower_bound", skip_serializing_if = "Option::is_none")]
pub lower_bound: Option<f32>,
/// Number of probes for IVF index
#[serde(rename = "nprobes", skip_serializing_if = "Option::is_none")]
pub nprobes: Option<i32>,
/// Number of results to skip
#[serde(rename = "offset", skip_serializing_if = "Option::is_none")]
pub offset: Option<i32>,
/// Whether to apply filtering before vector search
#[serde(rename = "prefilter", skip_serializing_if = "Option::is_none")]
pub prefilter: Option<bool>,
/// Refine factor for search
#[serde(rename = "refine_factor", skip_serializing_if = "Option::is_none")]
pub refine_factor: Option<i32>,
/// Upper bound for search
#[serde(rename = "upper_bound", skip_serializing_if = "Option::is_none")]
pub upper_bound: Option<f32>,
#[serde(rename = "vector")]
pub vector: Box<models::QueryTableRequestVector>,
/// 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.
#[serde(rename = "vector_column", skip_serializing_if = "Option::is_none")]
pub vector_column: Option<String>,
/// Table version to query
#[serde(rename = "version", skip_serializing_if = "Option::is_none")]
pub version: Option<i64>,
/// If true, return the row id as a column called `_rowid`
#[serde(rename = "with_row_id", skip_serializing_if = "Option::is_none")]
pub with_row_id: Option<bool>,
}
impl AnalyzeTableQueryPlanRequest {
pub fn new(k: i32, vector: models::QueryTableRequestVector) -> AnalyzeTableQueryPlanRequest {
AnalyzeTableQueryPlanRequest {
identity: None,
context: None,
id: None,
branch: None,
bypass_vector_index: None,
columns: None,
distance_type: None,
ef: None,
fast_search: None,
filter: None,
full_text_query: None,
k,
lower_bound: None,
nprobes: None,
offset: None,
prefilter: None,
refine_factor: None,
upper_bound: None,
vector: Box::new(vector),
vector_column: None,
version: None,
with_row_id: None,
}
}
}