Class: Arelastic::Aggregations::Sampler

Inherits:
Bucket show all
Defined in:
lib/arelastic/aggregations/sampler.rb

Instance Attribute Summary collapse

Attributes inherited from Bucket

#aggs

Attributes inherited from Aggregation

#meta, #name, #options

Instance Method Summary collapse

Methods inherited from Aggregation

#as_elastic, #nested, #reverse_nested

Methods inherited from Nodes::Node

#==, #convert_to_elastic, #hash, #read_option!

Methods included from Arelastic::Arities::Binary

#binary

Methods included from Arelastic::Arities::Polyadic

#polyadic

Methods included from Arelastic::Arities::Unary

#unary

Constructor Details

#initialize(name, shard_size, aggs) ⇒ Sampler

Returns a new instance of Sampler.



5
6
7
8
# File 'lib/arelastic/aggregations/sampler.rb', line 5

def initialize(name, shard_size, aggs)
  super(name, aggs: aggs)
  @shard_size = shard_size
end

Instance Attribute Details

#shard_sizeObject

Returns the value of attribute shard_size.



4
5
6
# File 'lib/arelastic/aggregations/sampler.rb', line 4

def shard_size
  @shard_size
end

Instance Method Details

#as_elastic_aggregationObject



10
11
12
# File 'lib/arelastic/aggregations/sampler.rb', line 10

def as_elastic_aggregation
  {'sampler' => { 'shard_size' => shard_size}}.merge(super)
end