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§
Source§impl DiversifiedSamplerAggregation
impl DiversifiedSamplerAggregation
Sourcepub fn shard_size(self, shard_size: u64) -> Self
pub fn shard_size(self, shard_size: 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: u64) -> Self
pub fn max_docs_per_value(self, max_docs_per_value: 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
)
Trait Implementations§
Source§impl Clone for DiversifiedSamplerAggregation
impl Clone for DiversifiedSamplerAggregation
Source§fn clone(&self) -> DiversifiedSamplerAggregation
fn clone(&self) -> DiversifiedSamplerAggregation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl From<DiversifiedSamplerAggregation> for Aggregation
impl From<DiversifiedSamplerAggregation> for Aggregation
Source§fn from(q: DiversifiedSamplerAggregation) -> Self
fn from(q: DiversifiedSamplerAggregation) -> Self
Source§impl PartialEq for DiversifiedSamplerAggregation
impl PartialEq for DiversifiedSamplerAggregation
Source§fn eq(&self, other: &DiversifiedSamplerAggregation) -> bool
fn eq(&self, other: &DiversifiedSamplerAggregation) -> bool
self
and other
values to be equal, and is used by ==
.