Class: Blocktrain::Aggregations::HistogramAggregation

Inherits:
Blocktrain::Aggregation show all
Defined in:
lib/blocktrain/aggregations/histogram_aggregation.rb

Direct Known Subclasses

AverageAggregation, MinMaxAggregation

Instance Method Summary collapse

Methods inherited from Blocktrain::Aggregation

#body, #initialize, #results

Methods inherited from Query

#address_query, #body, #build_query, #filtered_filter, #filtered_query, #hits, #initialize, #parse_datetime, #query, #results

Constructor Details

This class inherits a constructor from Blocktrain::Aggregation

Instance Method Details

#aggsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/blocktrain/aggregations/histogram_aggregation.rb', line 5

def aggs
  {
    results: {
      date_histogram: {
        field: 'timeStamp',
        interval: @interval,
        time_zone: '+01:00',
        min_doc_count: 1,
        extended_bounds: {
          min: @from,
          max: @to
        }
      },
      aggregations: local_aggregations
    }
  }
end