Class: Blocktrain::Aggregations::CarWeightAggregation

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

Instance Method Summary collapse

Methods inherited from Blocktrain::Aggregation

#address_query, #aggs, #body, #initialize, #parse_datetime, #query, #results

Constructor Details

This class inherits a constructor from Blocktrain::Aggregation

Instance Method Details

#local_aggregationsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/blocktrain/aggregations/car_weight_aggregation.rb', line 5

def local_aggregations
  {
    weight: {
      terms: { field: 'memoryAddress' },
      aggregations: {
        avg_weight: {
          avg: {
            field: 'value'
          }
        },
        max_weight: {
          max: {
            field: 'value'
          }
        },
        min_weight: {
          min: {
            field: 'value'
          }
        }
      }
    }
  }
end