Class: Arelastic::Aggregations::BucketSelector
- Inherits:
-
Aggregation
- Object
- Nodes::Node
- Aggregation
- Arelastic::Aggregations::BucketSelector
- Defined in:
- lib/arelastic/aggregations/bucket_selector.rb
Instance Attribute Summary collapse
-
#script ⇒ Object
Returns the value of attribute script.
-
#script_params ⇒ Object
Returns the value of attribute script_params.
Attributes inherited from Aggregation
Instance Method Summary collapse
- #as_elastic_aggregation ⇒ Object
-
#initialize(name, options = {}) ⇒ BucketSelector
constructor
A new instance of BucketSelector.
Methods inherited from Aggregation
#as_elastic, #nested, #reverse_nested
Methods inherited from Nodes::Node
#==, #convert_to_elastic, #read_option!
Methods included from Arelastic::Arities::Binary
Methods included from Arelastic::Arities::Polyadic
Methods included from Arelastic::Arities::Unary
Constructor Details
#initialize(name, options = {}) ⇒ BucketSelector
Returns a new instance of BucketSelector.
6 7 8 9 10 11 |
# File 'lib/arelastic/aggregations/bucket_selector.rb', line 6 def initialize(name, = {}) = .dup @script_params = read_option! , 'script_params' @script = read_option! , 'script' super(name, ) end |
Instance Attribute Details
#script ⇒ Object
Returns the value of attribute script.
4 5 6 |
# File 'lib/arelastic/aggregations/bucket_selector.rb', line 4 def script @script end |
#script_params ⇒ Object
Returns the value of attribute script_params.
4 5 6 |
# File 'lib/arelastic/aggregations/bucket_selector.rb', line 4 def script_params @script_params end |
Instance Method Details
#as_elastic_aggregation ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/arelastic/aggregations/bucket_selector.rb', line 13 def as_elastic_aggregation { 'bucket_selector' => { 'buckets_path' => script_params, 'script' => script } } end |