A newer version is available. For the latest information, see the
current release documentation.
Diversified Sampler Aggregation Usage
editDiversified Sampler Aggregation Usage
editFluent DSL example
edita => a .DiversifiedSampler("diversified_sample", sm => sm .ExecutionHint(DiversifiedSamplerAggregationExecutionHint.GlobalOrdinals) .Field(doc => doc.Type) .MaxDocsPerValue(10) .ShardSize(200) .Aggregations(aa => aa .SignificantTerms("significant_names", st => st .Field(p => p.Name) ) ) )
Object Initializer syntax example
editnew DiversifiedSamplerAggregation("diversified_sample") { ExecutionHint = DiversifiedSamplerAggregationExecutionHint.GlobalOrdinals, Field = new Field("type"), MaxDocsPerValue = 10, ShardSize = 200, Aggregations = new SignificantTermsAggregation("significant_names") { Field = "name" } }
Example json output.
{ "diversified_sample": { "diversified_sampler": { "execution_hint": "global_ordinals", "field": "type", "max_docs_per_value": 10, "shard_size": 200 }, "aggs": { "significant_names": { "significant_terms": { "field": "name" } } } } }