Class: Daedal::Queries::DisMaxQuery

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

Instance Method Summary collapse

Methods inherited from Query

#to_json

Instance Method Details

#to_hashObject



14
15
16
17
18
19
20
# File 'lib/daedal/queries/dis_max_query.rb', line 14

def to_hash
  result = {dis_max: {queries: queries.map {|q| q.to_hash }}}
  options = {tie_breaker: tie_breaker, boost: boost, _name: name}
  result[:dis_max].merge!(options.select { |k,v| !v.nil? })
  
  result
end