Class: Arelastic::Aggregations::BucketSort
- Inherits:
-
Aggregation
- Object
- Nodes::Node
- Aggregation
- Arelastic::Aggregations::BucketSort
- Defined in:
- lib/arelastic/aggregations/bucket_sort.rb
Instance Attribute Summary collapse
-
#sort ⇒ Object
Returns the value of attribute sort.
Attributes inherited from Aggregation
Instance Method Summary collapse
- #as_elastic_aggregation ⇒ Object
-
#initialize(name, options = {}) ⇒ BucketSort
constructor
A new instance of BucketSort.
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, options = {}) ⇒ BucketSort
Returns a new instance of BucketSort.
6 7 8 9 |
# File 'lib/arelastic/aggregations/bucket_sort.rb', line 6 def initialize(name, = {}) super @sort = read_option! , 'sort' end |
Instance Attribute Details
#sort ⇒ Object
Returns the value of attribute sort.
4 5 6 |
# File 'lib/arelastic/aggregations/bucket_sort.rb', line 4 def sort @sort end |
Instance Method Details
#as_elastic_aggregation ⇒ Object
11 12 13 14 15 |
# File 'lib/arelastic/aggregations/bucket_sort.rb', line 11 def as_elastic_aggregation params = params = params.merge('sort' => convert_to_elastic(sort)) if sort { 'bucket_sort' => params } end |