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
14
15
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct DocStats { /// The total number of non-deleted documents across all primary shards assigned to the selected nodes.
18 /// This number is based on documents in Lucene segments and may include documents from nested fields.
19 #[serde(rename = "count")]
20 pub count: u32, /// The total number of deleted documents across all primary shards assigned to the selected nodes.
21 /// This number is based on the number of documents stored in Lucene segments.
22 /// OpenSearch reclaims the disk space previously occupied by the deleted Lucene documents when a segment is merged.
23 #[serde(rename = "deleted", default, skip_serializing_if = "Option::is_none")]
24 pub deleted: Option<u32>,
25}
26
27impl DocStats {
28
29 pub fn new(count: u32) -> DocStats {
30 DocStats {
31 count,
32 deleted: None,
33 }
34 }
35}