Class: Elasticband::Query::Match
- Inherits:
-
Elasticband::Query
- Object
- Elasticband::Query
- Elasticband::Query::Match
- Defined in:
- lib/elasticband/query/match.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#options ⇒ Object
Returns the value of attribute options.
-
#query ⇒ Object
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(query, field = nil, options = {}) ⇒ Match
constructor
A new instance of Match.
- #to_h ⇒ Object
Methods inherited from Elasticband::Query
Constructor Details
#initialize(query, field = nil, options = {}) ⇒ Match
Returns a new instance of Match.
6 7 8 9 10 |
# File 'lib/elasticband/query/match.rb', line 6 def initialize(query, field = nil, = {}) self.query = query self.field = (field || :_all).to_sym self. = end |
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
4 5 6 |
# File 'lib/elasticband/query/match.rb', line 4 def field @field end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/elasticband/query/match.rb', line 4 def @options end |
#query ⇒ Object
Returns the value of attribute query.
4 5 6 |
# File 'lib/elasticband/query/match.rb', line 4 def query @query end |
Instance Method Details
#to_h ⇒ Object
12 13 14 |
# File 'lib/elasticband/query/match.rb', line 12 def to_h { match: { field => query_hash } } end |