opensearch_client/common/doc_stats.rs
1/*
2 * opensearch-client
3 *
4 * Rust Client for OpenSearch
5 *
6 * The version of the OpenAPI document: 3.1.0
7 * Contact: alberto.paro@gmail.com
8 * Generated by Paro OpenAPI Generator
9 */
10
11use serde::{Deserialize, Serialize};
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct DocStats {
15 /// The total number of non-deleted documents across all primary shards assigned to the selected nodes.
16 /// This number is based on documents in Lucene segments and may include documents from nested fields.
17 #[serde(rename = "count")]
18 pub count: u32,
19 /// The total number of deleted documents across all primary shards assigned to the selected nodes.
20 /// This number is based on the number of documents stored in Lucene segments.
21 /// OpenSearch reclaims the disk space previously occupied by the deleted Lucene documents when a segment is merged.
22 #[serde(rename = "deleted", default, skip_serializing_if = "Option::is_none")]
23 pub deleted: Option<u32>,
24}
25
26impl DocStats {
27 pub fn new(count: u32) -> DocStats {
28 DocStats {
29 count,
30 deleted: None,
31 }
32 }
33}