Class: Arelastic::Aggregations::Sampler
- Inherits:
-
Bucket
- Object
- Nodes::Node
- Aggregation
- Bucket
- Arelastic::Aggregations::Sampler
- Defined in:
- lib/arelastic/aggregations/sampler.rb
Instance Attribute Summary collapse
-
#shard_size ⇒ Object
Returns the value of attribute shard_size.
Attributes inherited from Bucket
Attributes inherited from Aggregation
Instance Method Summary collapse
- #as_elastic_aggregation ⇒ Object
-
#initialize(name, shard_size, aggs) ⇒ Sampler
constructor
A new instance of Sampler.
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
Methods included from Arelastic::Arities::Polyadic
Methods included from Arelastic::Arities::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_size ⇒ Object
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_aggregation ⇒ Object
10 11 12 |
# File 'lib/arelastic/aggregations/sampler.rb', line 10 def as_elastic_aggregation {'sampler' => { 'shard_size' => shard_size}}.merge(super) end |