/*
* 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 CreateTableIndexRequest {
#[serde(rename = "identity", skip_serializing_if = "Option::is_none")]
pub identity: Option<Box<models::Identity>>,
/// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_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>>,
/// Name of the column to create index on
#[serde(rename = "column")]
pub column: String,
/// Type of index to create (e.g., BTREE, BITMAP, LABEL_LIST, IVF_FLAT, IVF_PQ, IVF_HNSW_SQ, FTS)
#[serde(rename = "index_type")]
pub index_type: String,
/// Optional name for the index. If not provided, a name will be auto-generated.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Distance metric type for vector indexes (e.g., l2, cosine, dot)
#[serde(rename = "distance_type", skip_serializing_if = "Option::is_none")]
pub distance_type: Option<String>,
/// Optional FTS parameter for position tracking
#[serde(rename = "with_position", skip_serializing_if = "Option::is_none")]
pub with_position: Option<bool>,
/// Optional FTS parameter for base tokenizer
#[serde(rename = "base_tokenizer", skip_serializing_if = "Option::is_none")]
pub base_tokenizer: Option<String>,
/// Optional FTS parameter for language
#[serde(rename = "language", skip_serializing_if = "Option::is_none")]
pub language: Option<String>,
/// Optional FTS parameter for maximum token length
#[serde(rename = "max_token_length", skip_serializing_if = "Option::is_none")]
pub max_token_length: Option<i32>,
/// Optional FTS parameter for lowercase conversion
#[serde(rename = "lower_case", skip_serializing_if = "Option::is_none")]
pub lower_case: Option<bool>,
/// Optional FTS parameter for stemming
#[serde(rename = "stem", skip_serializing_if = "Option::is_none")]
pub stem: Option<bool>,
/// Optional FTS parameter for stop word removal
#[serde(rename = "remove_stop_words", skip_serializing_if = "Option::is_none")]
pub remove_stop_words: Option<bool>,
/// Optional FTS parameter for ASCII folding
#[serde(rename = "ascii_folding", skip_serializing_if = "Option::is_none")]
pub ascii_folding: Option<bool>,
}
impl CreateTableIndexRequest {
pub fn new(column: String, index_type: String) -> CreateTableIndexRequest {
CreateTableIndexRequest {
identity: None,
context: None,
id: None,
column,
index_type,
name: None,
distance_type: None,
with_position: None,
base_tokenizer: None,
language: None,
max_token_length: None,
lower_case: None,
stem: None,
remove_stop_words: None,
ascii_folding: None,
}
}
}