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



23
24
25
26
27
28
29
30
# File 'lib/daedal/queries/match_query.rb', line 23

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, max_expansions: max_expansions, prefix_length: prefix_length, lenient: lenient}
  result[:match][field].merge! options.select {|k,v| !v.nil?}
  
  result
end