Class: Elasticated::MissingAggregation

Inherits:
SingleValueAggregation show all
Includes:
Subaggregated
Defined in:
lib/elasticated/aggregations/missing_aggregation.rb

Instance Attribute Summary collapse

Attributes included from Subaggregated

#_subaggregations

Attributes inherited from Aggregation

#alias_name, #extra_params, #field

Instance Method Summary collapse

Methods included from Subaggregated

#initialize_subaggregations

Methods inherited from SingleValueAggregation

#default_name

Methods inherited from Aggregation

#name, #original_name

Methods included from Elasticated::Mixins::Inspectionable

#inspect, #text_for_inspect

Methods included from Elasticated::Mixins::BlockEvaluation

#evaluate

Methods included from Elasticated::Mixins::Clonable

#==, #clone

Constructor Details

#initialize(field, *args, &block) ⇒ MissingAggregation

Returns a new instance of MissingAggregation.



7
8
9
10
11
# File 'lib/elasticated/aggregations/missing_aggregation.rb', line 7

def initialize(field, *args, &block)
  super
  self.compact = extra_params.delete(:compact) { false }
  initialize_subaggregations &block
end

Instance Attribute Details

#compactObject

Returns the value of attribute compact.



5
6
7
# File 'lib/elasticated/aggregations/missing_aggregation.rb', line 5

def compact
  @compact
end

Instance Method Details

#buildObject

TODO: this is exactly the same as in GroupAggregation



19
20
21
# File 'lib/elasticated/aggregations/missing_aggregation.rb', line 19

def build
  super.merge build_subaggregations
end

#operationObject

implementation



14
15
16
# File 'lib/elasticated/aggregations/missing_aggregation.rb', line 14

def operation
  :missing
end

#parse(response) ⇒ Object



23
24
25
# File 'lib/elasticated/aggregations/missing_aggregation.rb', line 23

def parse(response)
  _subaggregations.empty? ? super : parse_subaggregations(response)
end