Skip to main content

lance_namespace_reqwest_client/models/
index_content.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 IndexContent {
16    /// Name of the index
17    #[serde(rename = "index_name")]
18    pub index_name: String,
19    /// Unique identifier for the index
20    #[serde(rename = "index_uuid")]
21    pub index_uuid: String,
22    /// Canonical Lance field paths covered by this index. Nested fields use dot-separated segments; segments containing literal dots are backtick-quoted, and backticks inside quoted segments are doubled.
23    #[serde(rename = "columns")]
24    pub columns: Vec<String>,
25    /// Current status of the index
26    #[serde(rename = "status")]
27    pub status: String,
28    /// Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index.
29    #[serde(rename = "index_type", skip_serializing_if = "Option::is_none")]
30    pub index_type: Option<String>,
31    /// Protobuf type URL, a precise type identifier for the index.
32    #[serde(rename = "type_url", skip_serializing_if = "Option::is_none")]
33    pub type_url: Option<String>,
34    /// Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted.
35    #[serde(rename = "num_indexed_rows", skip_serializing_if = "Option::is_none")]
36    pub num_indexed_rows: Option<i64>,
37    /// Number of rows that are not indexed.
38    #[serde(rename = "num_unindexed_rows", skip_serializing_if = "Option::is_none")]
39    pub num_unindexed_rows: Option<i64>,
40    /// Total index size in bytes across all segments. Null for indices predating file-size tracking.
41    #[serde(rename = "size_bytes", skip_serializing_if = "Option::is_none")]
42    pub size_bytes: Option<i64>,
43    /// Number of index deltas/segments.
44    #[serde(rename = "num_segments", skip_serializing_if = "Option::is_none")]
45    pub num_segments: Option<i32>,
46    /// Creation time for indexes. Null for legacy indices.
47    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
48    pub created_at: Option<String>,
49    /// On-disk index format version.
50    #[serde(rename = "index_version", skip_serializing_if = "Option::is_none")]
51    pub index_version: Option<i32>,
52    /// Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters.
53    #[serde(rename = "index_details", skip_serializing_if = "Option::is_none")]
54    pub index_details: Option<String>,
55}
56
57impl IndexContent {
58    pub fn new(index_name: String, index_uuid: String, columns: Vec<String>, status: String) -> IndexContent {
59        IndexContent {
60            index_name,
61            index_uuid,
62            columns,
63            status,
64            index_type: None,
65            type_url: None,
66            num_indexed_rows: None,
67            num_unindexed_rows: None,
68            size_bytes: None,
69            num_segments: None,
70            created_at: None,
71            index_version: None,
72            index_details: None,
73        }
74    }
75}
76