Class: RediSearch::Search::Clauses::Highlight
- Inherits:
-
ApplicationClause
- Object
- ApplicationClause
- RediSearch::Search::Clauses::Highlight
- Defined in:
- lib/redi_search/search/clauses/highlight.rb
Instance Method Summary collapse
- #clause ⇒ Object
-
#initialize(fields: [], opening_tag: "<b>", closing_tag: "</b>") ⇒ Highlight
constructor
A new instance of Highlight.
Methods inherited from ApplicationClause
#clause_order, clause_order, clause_term
Methods included from Validatable
Constructor Details
#initialize(fields: [], opening_tag: "<b>", closing_tag: "</b>") ⇒ Highlight
Returns a new instance of Highlight.
9 10 11 12 13 |
# File 'lib/redi_search/search/clauses/highlight.rb', line 9 def initialize(fields: [], opening_tag: "<b>", closing_tag: "</b>") @fields = fields @opening_tag = opening_tag @closing_tag = closing_tag end |
Instance Method Details
#clause ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/redi_search/search/clauses/highlight.rb', line 15 def clause [ "HIGHLIGHT", fields_clause, , ].compact.flatten(1) end |