Class: Sunspot::Query::Connective::Disjunction
- Defined in:
- lib/sunspot/query/connective.rb
Overview
Disjunctions combine their components with an OR operator.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_disjunction ⇒ Object
No-op - this is already a disjunction.
-
#to_boolean_phrase ⇒ Object
Express this disjunction as a Lucene boolean phrase.
Methods inherited from Abstract
#add_component, #add_conjunction, #add_negated_restriction, #add_negated_shorthand_restriction, #add_restriction, #add_shorthand_restriction, #initialize, #negate, #negated?
Methods included from Filter
Constructor Details
This class inherits a constructor from Sunspot::Query::Connective::Abstract
Class Method Details
.inverse ⇒ Object
126 127 128 |
# File 'lib/sunspot/query/connective.rb', line 126 def inverse Conjunction end |
Instance Method Details
#add_disjunction ⇒ Object
No-op - this is already a disjunction
145 146 147 |
# File 'lib/sunspot/query/connective.rb', line 145 def add_disjunction self end |
#to_boolean_phrase ⇒ Object
Express this disjunction as a Lucene boolean phrase
134 135 136 137 138 139 140 |
# File 'lib/sunspot/query/connective.rb', line 134 def to_boolean_phrase if @components.any? { |component| component.negated? } denormalize.to_boolean_phrase else super end end |