Class: Arelastic::Builders::Query
- Inherits:
-
Struct
- Object
- Struct
- Arelastic::Builders::Query
- Defined in:
- lib/arelastic/builders/query.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
- .[](field) ⇒ Object
- .constant_score(search) ⇒ Object
- .filtered(query: nil, filter: nil) ⇒ Object
- .match_all ⇒ Object
- .multi_match(query, fields, options = {}) ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
3 4 5 |
# File 'lib/arelastic/builders/query.rb', line 3 def name @name end |
Class Method Details
.[](field) ⇒ Object
5 6 7 |
# File 'lib/arelastic/builders/query.rb', line 5 def [](field) new(field) end |
.constant_score(search) ⇒ Object
9 10 11 |
# File 'lib/arelastic/builders/query.rb', line 9 def constant_score(search) query Arelastic::Queries::ConstantScore.new(search) end |
.filtered(query: nil, filter: nil) ⇒ Object
13 14 15 |
# File 'lib/arelastic/builders/query.rb', line 13 def filtered(query: nil, filter: nil) query Arelastic::Queries::Filtered.new(query: query, filter: filter) end |
.match_all ⇒ Object
17 18 19 |
# File 'lib/arelastic/builders/query.rb', line 17 def match_all query Arelastic::Queries::MatchAll.new end |
.multi_match(query, fields, options = {}) ⇒ Object
21 22 23 |
# File 'lib/arelastic/builders/query.rb', line 21 def multi_match(query, fields, = {}) query Arelastic::Queries::MultiMatch.new query, fields, end |
Instance Method Details
#field(other) ⇒ Object
31 32 33 |
# File 'lib/arelastic/builders/query.rb', line 31 def field other Arelastic::Queries::Field.new name, other end |
#match(other) ⇒ Object
43 44 45 |
# File 'lib/arelastic/builders/query.rb', line 43 def match other Arelastic::Queries::Match.new name, other end |