Class: Lycra::Search::Filters

Inherits:
Array
  • Object
show all
Defined in:
lib/lycra/search/filters.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/filters.rb', line 4

def to_query
  return {} if empty?

  filters = {}
  filters.merge!(must_filters) unless must_filters.empty?
  filters.merge!(must_not_filters) unless must_not_filters.empty?
  {bool: filters}
end