Class: Elasticband::Query::MultiMatch

Inherits:
Elasticband::Query show all
Defined in:
lib/elasticband/query/multi_match.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Elasticband::Query

parse

Constructor Details

#initialize(query, fields = [:_all], options = {}) ⇒ MultiMatch

Returns a new instance of MultiMatch.



6
7
8
9
10
# 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

Instance Attribute Details

#fieldsObject

Returns the value of attribute fields.



4
5
6
# File 'lib/elasticband/query/multi_match.rb', line 4

def fields
  @fields
end

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/elasticband/query/multi_match.rb', line 4

def options
  @options
end

#queryObject

Returns the value of attribute query.



4
5
6
# File 'lib/elasticband/query/multi_match.rb', line 4

def query
  @query
end

Instance Method Details

#to_hObject



12
13
14
# File 'lib/elasticband/query/multi_match.rb', line 12

def to_h
  { multi_match: query_hash }
end