class Elasticband::Query::MultiMatch

Attributes

fields[RW]
options[RW]
query[RW]

Public Class Methods

new(query, fields = [:_all], options = {}) click to toggle source
# File lib/elasticband/query/multi_match.rb, line 6
def initialize(query, fields = [:_all], options = {})
  self.query = query
  self.fields = Array.wrap(fields).map(&:to_sym)
  self.options = options
end

Public Instance Methods

to_h() click to toggle source
# File lib/elasticband/query/multi_match.rb, line 12
def to_h
  { multi_match: query_hash }
end

Private Instance Methods

query_hash() click to toggle source
# File lib/elasticband/query/multi_match.rb, line 18
def query_hash
  { query: query }.merge!(options).merge!(fields: fields)
end