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