Class: Eson::Search::MultiMatch

Inherits:
Object
  • Object
show all
Includes:
Query
Defined in:
lib/eson/search/multi_match.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Query

included, #method_missing

Constructor Details

#initialize(query, options = {}) ⇒ MultiMatch

Returns a new instance of MultiMatch.



11
12
13
14
# File 'lib/eson/search/multi_match.rb', line 11

def initialize(query, options = {})
  self.options = options
  self.query = query
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Eson::Search::Query

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/eson/search/multi_match.rb', line 9

def options
  @options
end

#queryObject

Returns the value of attribute query.



9
10
11
# File 'lib/eson/search/multi_match.rb', line 9

def query
  @query
end

Instance Method Details

#multi_match { ... } ⇒ self

Generates a ‘multi_match` query in a query context.

Yields:

  • the block containing further options and subqueries

Returns:

  • (self)

    the generated facet



7
# File 'lib/eson/search/multi_match.rb', line 7

short_name :multi_match

#to_query_hashObject



16
17
18
# File 'lib/eson/search/multi_match.rb', line 16

def to_query_hash
  {:multi_match => {:query => query}.merge!(options)}
end