pub struct DiversifiedSamplerAggregation { /* private fields */ }Expand description
Like the sampler aggregation this is a filtering aggregation used to limit any sub aggregations’ processing to a sample of the top-scoring documents. The diversified_sampler aggregation adds the ability to limit the number of matches that share a common value such as an “author”.
Implementations
sourceimpl DiversifiedSamplerAggregation
impl DiversifiedSamplerAggregation
sourcepub fn shard_size(self, shard_size: impl TryInto<u64>) -> Self
pub fn shard_size(self, shard_size: impl TryInto<u64>) -> Self
The shard_size parameter limits how many top-scoring documents are
collected in the sample processed on each shard. The default value is 100.
sourcepub fn max_docs_per_value(self, max_docs_per_value: impl TryInto<u64>) -> Self
pub fn max_docs_per_value(self, max_docs_per_value: impl TryInto<u64>) -> Self
The max_docs_per_value is an optional parameter and limits how many documents
are permitted per choice of de-duplicating value. The default setting is “1”.
sourcepub fn execution_hint(self, execution_hint: ExecutionHint) -> Self
pub fn execution_hint(self, execution_hint: ExecutionHint) -> Self
The optional execution_hint setting can influence the management of the values
used for de-duplication. Each option will hold up to shard_size values in memory
while performing de-duplication but the type of value held can be controlled as follows:
- hold field values directly (
map) - hold ordinals of the field as determined by the Lucene index (
global_ordinals) - hold hashes of the field values - with potential for hash collisions (
bytes_hash)
sourcepub fn aggregate<N, A>(self, aggregation_name: N, aggregation: A) -> Self where
N: Into<AggregationName>,
A: Into<Aggregation>,
pub fn aggregate<N, A>(self, aggregation_name: N, aggregation: A) -> Self where
N: Into<AggregationName>,
A: Into<Aggregation>,
Pushes aggregation
Trait Implementations
sourceimpl Clone for DiversifiedSamplerAggregation
impl Clone for DiversifiedSamplerAggregation
sourcefn clone(&self) -> DiversifiedSamplerAggregation
fn clone(&self) -> DiversifiedSamplerAggregation
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 DiversifiedSamplerAggregation
impl Debug for DiversifiedSamplerAggregation
sourceimpl From<DiversifiedSamplerAggregation> for Aggregation
impl From<DiversifiedSamplerAggregation> for Aggregation
sourcefn from(q: DiversifiedSamplerAggregation) -> Self
fn from(q: DiversifiedSamplerAggregation) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<DiversifiedSamplerAggregation> for DiversifiedSamplerAggregation
impl PartialEq<DiversifiedSamplerAggregation> for DiversifiedSamplerAggregation
sourcefn eq(&self, other: &DiversifiedSamplerAggregation) -> bool
fn eq(&self, other: &DiversifiedSamplerAggregation) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &DiversifiedSamplerAggregation) -> bool
fn ne(&self, other: &DiversifiedSamplerAggregation) -> bool
This method tests for !=.
impl StructuralPartialEq for DiversifiedSamplerAggregation
Auto Trait Implementations
impl RefUnwindSafe for DiversifiedSamplerAggregation
impl Send for DiversifiedSamplerAggregation
impl Sync for DiversifiedSamplerAggregation
impl Unpin for DiversifiedSamplerAggregation
impl UnwindSafe for DiversifiedSamplerAggregation
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