Class: Elastic::Nodes::Match
- Includes:
- Concerns::Boostable, Concerns::FieldQuery
- Defined in:
- lib/elastic/nodes/match.rb
Constant Summary collapse
- MATCH_MODES =
[:boolean, :phrase, :phrase_prefix]
Instance Attribute Summary collapse
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#query ⇒ Object
Returns the value of attribute query.
Attributes included from Concerns::FieldQuery
Attributes included from Concerns::Boostable
Instance Method Summary collapse
Methods included from Concerns::FieldQuery
Methods inherited from Base
#==, #handle_result, #traverse
Methods included from Support::Traversable
Instance Attribute Details
#mode ⇒ Object
Returns the value of attribute mode.
9 10 11 |
# File 'lib/elastic/nodes/match.rb', line 9 def mode @mode end |
#query ⇒ Object
Returns the value of attribute query.
8 9 10 |
# File 'lib/elastic/nodes/match.rb', line 8 def query @query end |
Instance Method Details
#clone ⇒ Object
22 23 24 |
# File 'lib/elastic/nodes/match.rb', line 22 def clone prepare_clone(super) end |
#render(_options = {}) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/elastic/nodes/match.rb', line 30 def render( = {}) hash = { 'query' => @query } match_mode = @mode.nil? || @mode == :boolean ? 'match' : "match_#{@mode}" { match_mode => { render_field() => render_boost(hash) } } end |
#simplify ⇒ Object
26 27 28 |
# File 'lib/elastic/nodes/match.rb', line 26 def simplify prepare_clone(super) end |