Class: Sunspot::Query::Restriction::EqualTo

Inherits:
Base
  • Object
show all
Defined in:
lib/sunspot/query/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::Query::Restriction::Base

Instance Method Details

#to_negative_boolean_phraseObject



137
138
139
140
141
142
143
# File 'lib/sunspot/query/restriction.rb', line 137

def to_negative_boolean_phrase
  unless @value.nil?
    super
  else
    "#{Solr::Util.query_parser_escape(@field.indexed_name)}:[* TO *]"
  end
end

#to_positive_boolean_phraseObject



129
130
131
132
133
134
135
# File 'lib/sunspot/query/restriction.rb', line 129

def to_positive_boolean_phrase
  unless @value.nil?
    super
  else
    "-#{Solr::Util.query_parser_escape(@field.indexed_name)}:[* TO *]"
  end
end