elasticsearch_dsl/search/response/
hits_metadata.rs

1use super::{Hit, TotalHits};
2use crate::util::ShouldSkip;
3
4/// Matched hits
5#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
6pub struct HitsMetadata {
7    /// Total number of matched documents
8    #[serde(skip_serializing_if = "ShouldSkip::should_skip")]
9    pub total: Option<TotalHits>,
10
11    /// Maximum document score. [`None`] when documents are implicitly sorted
12    /// by a field other than `_score`
13    #[serde(skip_serializing_if = "ShouldSkip::should_skip")]
14    pub max_score: Option<f32>,
15
16    /// Matched hits
17    #[serde(default = "Vec::new")]
18    pub hits: Vec<Hit>,
19}