Class: Aggregations::Buckets::GeoGridAggregationBuilder

Inherits:
Object
  • Object
show all
Includes:
Helpers::AbstractAggregationHelper, Helpers::AggregationQueryBuilderHelper, Helpers::ValuesSourceAggregationHelper, AttributesReader
Defined in:
lib/aggregations/buckets/geo_grid_aggregation_builder.rb

Overview

Elasticsearch GeoHash grid Aggregation

Constant Summary collapse

ATTRIBUTES =
[:size, :precision]

Constants included from Helpers::AggregationQueryBuilderHelper

Helpers::AggregationQueryBuilderHelper::OBJECT_ARRAY_QUERY_FIELDS, Helpers::AggregationQueryBuilderHelper::OBJECT_ARRAY_SETTINGS_FIELDS

Instance Method Summary collapse

Methods included from AttributesReader

#attributes

Methods included from Helpers::AggregationQueryBuilderHelper

#name_expr, #query, #type_expr

Methods included from Helpers::AbstractAggregationHelper

#abstract_agg_builder, #sub_aggregation, #sub_aggregation_expr

Methods included from Helpers::ValuesSourceAggregationHelper

#field, #field_expr, #missing, #missing_expr, #script, #script_expr, #value_source_agg_builder

Constructor Details

#initialize(name:) ⇒ GeoGridAggregationBuilder

Returns a new instance of GeoGridAggregationBuilder.

Parameters:

  • name (String)

    : Aggregation name



14
15
16
17
18
19
20
21
22
# File 'lib/aggregations/buckets/geo_grid_aggregation_builder.rb', line 14

def initialize name:
  @name = name.intern
  @type = :geohash_grid
  @query = {
    @name => {
      @type => {}
    }
  }
end

Instance Method Details

#precision(precision) ⇒ GeoGridAggregationBuilder

Parameters:

  • precision (Integer)

Returns:



38
39
40
41
# File 'lib/aggregations/buckets/geo_grid_aggregation_builder.rb', line 38

def precision precision
  @precision = precision
  self
end

#precision_exprInteger

Returns:

  • (Integer)


44
45
46
# File 'lib/aggregations/buckets/geo_grid_aggregation_builder.rb', line 44

def precision_expr
  @precision
end

#size(size) ⇒ GeoGridAggregationBuilder

Parameters:

  • size (Integer)

Returns:



26
27
28
29
# File 'lib/aggregations/buckets/geo_grid_aggregation_builder.rb', line 26

def size size
  @size = size
  self
end

#size_exprInteger

Returns:

  • (Integer)


32
33
34
# File 'lib/aggregations/buckets/geo_grid_aggregation_builder.rb', line 32

def size_expr
  @size
end