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://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 CreateTableIndexRequest {
16    #[serde(rename = "identity", skip_serializing_if = "Option::is_none")]
17    pub identity: Option<Box<models::Identity>>,
18    /// 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`. 
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    /// Name of the column to create index on
24    #[serde(rename = "column")]
25    pub column: String,
26    /// Type of index to create (e.g., BTREE, BITMAP, LABEL_LIST, IVF_FLAT, IVF_PQ, IVF_HNSW_SQ, FTS)
27    #[serde(rename = "index_type")]
28    pub index_type: String,
29    /// Optional name for the index. If not provided, a name will be auto-generated.
30    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
31    pub name: Option<String>,
32    /// Distance metric type for vector indexes (e.g., l2, cosine, dot)
33    #[serde(rename = "distance_type", skip_serializing_if = "Option::is_none")]
34    pub distance_type: Option<String>,
35    /// Optional FTS parameter for position tracking
36    #[serde(rename = "with_position", skip_serializing_if = "Option::is_none")]
37    pub with_position: Option<bool>,
38    /// Optional FTS parameter for base tokenizer
39    #[serde(rename = "base_tokenizer", skip_serializing_if = "Option::is_none")]
40    pub base_tokenizer: Option<String>,
41    /// Optional FTS parameter for language
42    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
43    pub language: Option<String>,
44    /// Optional FTS parameter for maximum token length
45    #[serde(rename = "max_token_length", skip_serializing_if = "Option::is_none")]
46    pub max_token_length: Option<i32>,
47    /// Optional FTS parameter for lowercase conversion
48    #[serde(rename = "lower_case", skip_serializing_if = "Option::is_none")]
49    pub lower_case: Option<bool>,
50    /// Optional FTS parameter for stemming
51    #[serde(rename = "stem", skip_serializing_if = "Option::is_none")]
52    pub stem: Option<bool>,
53    /// Optional FTS parameter for stop word removal
54    #[serde(rename = "remove_stop_words", skip_serializing_if = "Option::is_none")]
55    pub remove_stop_words: Option<bool>,
56    /// Optional FTS parameter for ASCII folding
57    #[serde(rename = "ascii_folding", skip_serializing_if = "Option::is_none")]
58    pub ascii_folding: Option<bool>,
59}
60
61impl CreateTableIndexRequest {
62    pub fn new(column: String, index_type: String) -> CreateTableIndexRequest {
63        CreateTableIndexRequest {
64            identity: None,
65            context: None,
66            id: None,
67            column,
68            index_type,
69            name: None,
70            distance_type: None,
71            with_position: None,
72            base_tokenizer: None,
73            language: None,
74            max_token_length: None,
75            lower_case: None,
76            stem: None,
77            remove_stop_words: None,
78            ascii_folding: None,
79        }
80    }
81}
82