Class: Daedal::Queries::MatchQuery

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

Instance Method Summary collapse

Methods inherited from Query

#to_json

Instance Method Details

#to_hashObject



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

def to_hash
  
  result = {match: {field => {query: query}}}
  options = {minimum_should_match: minimum_should_match, cutoff_frequency: cutoff_frequency, type: type, analyzer: analyzer, boost: boost, fuzziness: fuzziness, operator: operator, slop: slop}
  result[:match][field].merge! options.select {|k,v| !v.nil?}
  
  result
end