Module: Aggregations::Helpers::ValuesSourceAggregationHelper
- Included in:
- Buckets::DateHistogramAggregationBuilder, Buckets::DateRangeAggregationBuilder, Buckets::GeoGridAggregationBuilder, Buckets::HistogramAggregationBuilder, Buckets::RangeAggregationBuilder, Buckets::TermsAggregationBuilder, Metrics::AvgAggregationBuilder, Metrics::MaxAggregationBuilder, Metrics::MinAggregationBuilder
- Defined in:
- lib/aggregations/helpers/values_source_aggregation_helper.rb
Instance Method Summary collapse
- #field(field) ⇒ ValuesSourceAggregationHelper
- #field_expr ⇒ String
- #missing(missing) ⇒ ValuesSourceAggregationHelper
- #missing_expr ⇒ String
- #script(script) ⇒ ValuesSourceAggregationHelper
- #script_expr ⇒ Misc::Script
-
#value_source_agg_builder ⇒ Object
helper method to add values source attributes to aggregation.
Instance Method Details
#field(field) ⇒ ValuesSourceAggregationHelper
17 18 19 20 |
# File 'lib/aggregations/helpers/values_source_aggregation_helper.rb', line 17 def field field @field = field self end |
#field_expr ⇒ String
23 24 25 |
# File 'lib/aggregations/helpers/values_source_aggregation_helper.rb', line 23 def field_expr @field end |
#missing(missing) ⇒ ValuesSourceAggregationHelper
41 42 43 44 |
# File 'lib/aggregations/helpers/values_source_aggregation_helper.rb', line 41 def missing missing @missing = missing self end |
#missing_expr ⇒ String
47 48 49 |
# File 'lib/aggregations/helpers/values_source_aggregation_helper.rb', line 47 def missing_expr @missing end |
#script(script) ⇒ ValuesSourceAggregationHelper
29 30 31 32 |
# File 'lib/aggregations/helpers/values_source_aggregation_helper.rb', line 29 def script script @script = script self end |
#script_expr ⇒ Misc::Script
35 36 37 |
# File 'lib/aggregations/helpers/values_source_aggregation_helper.rb', line 35 def script_expr @script end |
#value_source_agg_builder ⇒ Object
helper method to add values source attributes to aggregation.
7 8 9 10 11 12 13 |
# File 'lib/aggregations/helpers/values_source_aggregation_helper.rb', line 7 def value_source_agg_builder builder = {} builder[:field] = @field if @field.present? builder[:script] = @script.settings if @script.present? builder[:missing] = @missing if @missing.present? builder end |