Class: Arelastic::Builders::Aggregation

Inherits:
Struct
  • Object
show all
Defined in:
lib/arelastic/builders/aggregation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



3
4
5
# File 'lib/arelastic/builders/aggregation.rb', line 3

def name
  @name
end

Class Method Details

.[](name) ⇒ Object



5
6
7
# File 'lib/arelastic/builders/aggregation.rb', line 5

def [](name)
  new(name)
end

Instance Method Details

#date_histogram(options) ⇒ Object



10
11
12
# File 'lib/arelastic/builders/aggregation.rb', line 10

def date_histogram options
  Arelastic::Aggregations::DateHistogram.new name, options
end

#filter(filter, options) ⇒ Object



14
15
16
# File 'lib/arelastic/builders/aggregation.rb', line 14

def filter filter, options
  Arelastic::Aggregations::Filter.new name, filter, options
end

#histogram(options) ⇒ Object



18
19
20
# File 'lib/arelastic/builders/aggregation.rb', line 18

def histogram options
  Arelastic::Aggregations::Histogram.new name, options
end

#sample(shard_size, aggs) ⇒ Object



22
23
24
# File 'lib/arelastic/builders/aggregation.rb', line 22

def sample shard_size, aggs
  Arelastic::Aggregations::Sampler.new(name, sample_size, aggs)
end

#terms(options = {}) ⇒ Object



26
27
28
# File 'lib/arelastic/builders/aggregation.rb', line 26

def terms options = {}
  Arelastic::Aggregations::Terms.new(name, options)
end