lance_namespace_reqwest_client/models/
create_table_index_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://lancedb.github.io/lance-namespace/spec/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://lancedb.github.io/lance-namespace/spec/impls/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 CreateTableIndexRequest {
16    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
17    pub id: Option<Vec<String>>,
18    /// Name of the column to create index on
19    #[serde(rename = "column")]
20    pub column: String,
21    /// Type of index to create
22    #[serde(rename = "index_type")]
23    pub index_type: IndexType,
24    /// Distance metric type for vector indexes
25    #[serde(rename = "metric_type", skip_serializing_if = "Option::is_none")]
26    pub metric_type: Option<MetricType>,
27    /// Optional FTS parameter for position tracking
28    #[serde(rename = "with_position", skip_serializing_if = "Option::is_none")]
29    pub with_position: Option<bool>,
30    /// Optional FTS parameter for base tokenizer
31    #[serde(rename = "base_tokenizer", skip_serializing_if = "Option::is_none")]
32    pub base_tokenizer: Option<String>,
33    /// Optional FTS parameter for language
34    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
35    pub language: Option<String>,
36    /// Optional FTS parameter for maximum token length
37    #[serde(rename = "max_token_length", skip_serializing_if = "Option::is_none")]
38    pub max_token_length: Option<i32>,
39    /// Optional FTS parameter for lowercase conversion
40    #[serde(rename = "lower_case", skip_serializing_if = "Option::is_none")]
41    pub lower_case: Option<bool>,
42    /// Optional FTS parameter for stemming
43    #[serde(rename = "stem", skip_serializing_if = "Option::is_none")]
44    pub stem: Option<bool>,
45    /// Optional FTS parameter for stop word removal
46    #[serde(rename = "remove_stop_words", skip_serializing_if = "Option::is_none")]
47    pub remove_stop_words: Option<bool>,
48    /// Optional FTS parameter for ASCII folding
49    #[serde(rename = "ascii_folding", skip_serializing_if = "Option::is_none")]
50    pub ascii_folding: Option<bool>,
51}
52
53impl CreateTableIndexRequest {
54    pub fn new(column: String, index_type: IndexType) -> CreateTableIndexRequest {
55        CreateTableIndexRequest {
56            id: None,
57            column,
58            index_type,
59            metric_type: None,
60            with_position: None,
61            base_tokenizer: None,
62            language: None,
63            max_token_length: None,
64            lower_case: None,
65            stem: None,
66            remove_stop_words: None,
67            ascii_folding: None,
68        }
69    }
70}
71/// Type of index to create
72#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
73pub enum IndexType {
74    #[serde(rename = "BTREE")]
75    Btree,
76    #[serde(rename = "BITMAP")]
77    Bitmap,
78    #[serde(rename = "LABEL_LIST")]
79    LabelList,
80    #[serde(rename = "IVF_FLAT")]
81    IvfFlat,
82    #[serde(rename = "IVF_PQ")]
83    IvfPq,
84    #[serde(rename = "IVF_HNSW_SQ")]
85    IvfHnswSq,
86    #[serde(rename = "FTS")]
87    Fts,
88}
89
90impl Default for IndexType {
91    fn default() -> IndexType {
92        Self::Btree
93    }
94}
95/// Distance metric type for vector indexes
96#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
97pub enum MetricType {
98    #[serde(rename = "l2")]
99    L2,
100    #[serde(rename = "cosine")]
101    Cosine,
102    #[serde(rename = "dot")]
103    Dot,
104}
105
106impl Default for MetricType {
107    fn default() -> MetricType {
108        Self::L2
109    }
110}
111