Class: Sunspot::Restriction::EqualTo
- Defined in:
- lib/sunspot/restriction.rb
Overview
Results must have field with value equal to given value. If the value is nil, results must have no value for the given field.
Instance Method Summary collapse
Methods inherited from Base
#initialize, #to_boolean_phrase, #to_params
Constructor Details
This class inherits a constructor from Sunspot::Restriction::Base
Instance Method Details
#to_negative_boolean_phrase ⇒ Object
131 132 133 134 135 136 137 |
# File 'lib/sunspot/restriction.rb', line 131 def to_negative_boolean_phrase unless @value.nil? super else "#{@field.indexed_name}:[* TO *]" end end |
#to_positive_boolean_phrase ⇒ Object
123 124 125 126 127 128 129 |
# File 'lib/sunspot/restriction.rb', line 123 def to_positive_boolean_phrase unless @value.nil? super else "-#{@field.indexed_name}:[* TO *]" end end |