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 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\"}`.
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 vector index parameter for the number of IVF partitions. Applies to all IVF index types.
39 #[serde(rename = "num_partitions", skip_serializing_if = "Option::is_none")]
40 pub num_partitions: Option<i32>,
41 /// Optional vector index parameter for the number of PQ sub-vectors. Applies to IVF_PQ only.
42 #[serde(rename = "num_sub_vectors", skip_serializing_if = "Option::is_none")]
43 pub num_sub_vectors: Option<i32>,
44 /// Optional vector index parameter for the number of bits used by the quantizer.
45 #[serde(rename = "num_bits", skip_serializing_if = "Option::is_none")]
46 pub num_bits: Option<i32>,
47 /// Optional vector index parameter for the per-partition sample rate used during IVF training.
48 #[serde(rename = "sample_rate", skip_serializing_if = "Option::is_none")]
49 pub sample_rate: Option<i32>,
50 /// Optional vector index parameter for the maximum number of IVF k-means training iterations.
51 #[serde(rename = "max_iterations", skip_serializing_if = "Option::is_none")]
52 pub max_iterations: Option<i32>,
53 /// Optional vector index parameter for the target partition size. Alternative to num_partitions.
54 #[serde(rename = "target_partition_size", skip_serializing_if = "Option::is_none")]
55 pub target_partition_size: Option<i32>,
56 /// Optional vector index parameter for the number of edges per node in the HNSW graph. Applies to HNSW index types.
57 #[serde(rename = "m", skip_serializing_if = "Option::is_none")]
58 pub m: Option<i32>,
59 /// Optional vector index parameter for the number of candidates evaluated during HNSW graph construction. Applies to HNSW index types.
60 #[serde(rename = "ef_construction", skip_serializing_if = "Option::is_none")]
61 pub ef_construction: Option<i32>,
62 /// Optional FTS parameter for position tracking
63 #[serde(rename = "with_position", skip_serializing_if = "Option::is_none")]
64 pub with_position: Option<bool>,
65 /// Optional FTS parameter for base tokenizer
66 #[serde(rename = "base_tokenizer", skip_serializing_if = "Option::is_none")]
67 pub base_tokenizer: Option<String>,
68 /// Optional FTS parameter for language
69 #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
70 pub language: Option<String>,
71 /// Optional FTS parameter for maximum token length
72 #[serde(rename = "max_token_length", skip_serializing_if = "Option::is_none")]
73 pub max_token_length: Option<i32>,
74 /// Optional FTS parameter for lowercase conversion
75 #[serde(rename = "lower_case", skip_serializing_if = "Option::is_none")]
76 pub lower_case: Option<bool>,
77 /// Optional FTS parameter for stemming
78 #[serde(rename = "stem", skip_serializing_if = "Option::is_none")]
79 pub stem: Option<bool>,
80 /// Optional FTS parameter for stop word removal
81 #[serde(rename = "remove_stop_words", skip_serializing_if = "Option::is_none")]
82 pub remove_stop_words: Option<bool>,
83 /// Optional FTS parameter for ASCII folding
84 #[serde(rename = "ascii_folding", skip_serializing_if = "Option::is_none")]
85 pub ascii_folding: Option<bool>,
86}
87
88impl CreateTableIndexRequest {
89 pub fn new(column: String, index_type: String) -> CreateTableIndexRequest {
90 CreateTableIndexRequest {
91 identity: None,
92 context: None,
93 id: None,
94 branch: None,
95 column,
96 index_type,
97 name: None,
98 distance_type: None,
99 num_partitions: None,
100 num_sub_vectors: None,
101 num_bits: None,
102 sample_rate: None,
103 max_iterations: None,
104 target_partition_size: None,
105 m: None,
106 ef_construction: None,
107 with_position: None,
108 base_tokenizer: None,
109 language: None,
110 max_token_length: None,
111 lower_case: None,
112 stem: None,
113 remove_stop_words: None,
114 ascii_folding: None,
115 }
116 }
117}
118