Struct elasticsearch_dsl::search::aggregations::metrics::TopHitsAggregation
source · [−]pub struct TopHitsAggregation { /* private fields */ }Expand description
A top_hits metric aggregation keeps track of the most relevant document being aggregated.
This aggregation is intended to be used as a sub aggregation,
so that the top matching documents can be aggregated per bucket.
We do not recommend using
top_hitsas a top-level aggregation. If you want to group search hits, use thecollapseparameter instead.
The top_hits aggregation can effectively be used to group result sets
by certain fields via a bucket aggregation. One or more bucket aggregations
determines by which properties a result set get sliced into.
Implementations
sourceimpl TopHitsAggregation
impl TopHitsAggregation
sourcepub fn source(self, source: impl Into<SourceFilter>) -> Self
pub fn source(self, source: impl Into<SourceFilter>) -> Self
Indicates which source fields are returned for matching documents
sourcepub fn from(self, from: impl TryInto<u64>) -> Self
pub fn from(self, from: impl TryInto<u64>) -> Self
The offset from the first result you want to fetch.
Trait Implementations
sourceimpl Clone for TopHitsAggregation
impl Clone for TopHitsAggregation
sourcefn clone(&self) -> TopHitsAggregation
fn clone(&self) -> TopHitsAggregation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for TopHitsAggregation
impl Debug for TopHitsAggregation
sourceimpl From<TopHitsAggregation> for Aggregation
impl From<TopHitsAggregation> for Aggregation
sourcefn from(q: TopHitsAggregation) -> Self
fn from(q: TopHitsAggregation) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<TopHitsAggregation> for TopHitsAggregation
impl PartialEq<TopHitsAggregation> for TopHitsAggregation
sourcefn eq(&self, other: &TopHitsAggregation) -> bool
fn eq(&self, other: &TopHitsAggregation) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &TopHitsAggregation) -> bool
fn ne(&self, other: &TopHitsAggregation) -> bool
This method tests for !=.
sourceimpl Serialize for TopHitsAggregation
impl Serialize for TopHitsAggregation
impl StructuralPartialEq for TopHitsAggregation
Auto Trait Implementations
impl RefUnwindSafe for TopHitsAggregation
impl Send for TopHitsAggregation
impl Sync for TopHitsAggregation
impl Unpin for TopHitsAggregation
impl UnwindSafe for TopHitsAggregation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more