Class: Lycra::Search::Aggregations

Inherits:
Array
  • Object
show all
Defined in:
lib/lycra/search/aggregations.rb

Instance Method Summary collapse

Instance Method Details

#to_queryObject Also known as: to_q



4
5
6
7
8
9
10
11
# File 'lib/lycra/search/aggregations.rb', line 4

def to_query
  return {} if empty?

  # can probably inject here or be a bit more elegant?
  aggregations = {}
  each { |agg| aggregations.merge!(agg) }
  aggregations
end