Class: Daedal::Queries::BoolQuery

Inherits:
Query
  • Object
show all
Defined in:
lib/daedal/queries/bool_query.rb

Instance Method Summary collapse

Methods inherited from Query

#to_json

Instance Method Details

#to_hashObject



20
21
22
23
24
25
26
# File 'lib/daedal/queries/bool_query.rb', line 20

def to_hash
  result = {bool: {should: should.map {|q| q.to_hash}, must: must.map {|q| q.to_hash}, must_not: must_not.map {|q| q.to_hash}}}
  options = {minimum_should_match: minimum_should_match, boost: boost, _name: name, disable_coord: disable_coord}
  result[:bool].merge!(options.select { |k,v| !v.nil? })
  
  result
end