class NotExpression
Attributes
operand[RW]
Public Class Methods
new(exp)
click to toggle source
# File lib/parsing_nesting/tree.rb, line 326 def initialize(exp) self.operand = exp end
Public Instance Methods
can_embed?()
click to toggle source
# File lib/parsing_nesting/tree.rb, line 345 def can_embed? false end
negate()
click to toggle source
# File lib/parsing_nesting/tree.rb, line 349 def negate operand end
to_query(solr_params)
click to toggle source
We have to do the weird thing with : AND NOT (real thing), because Solr 1.4.1 seems not to be able to handle “x OR NOT y” otherwise, at least in some cases, but does fine with “x OR (: AND NOT y)”, which should mean the same thing.
# File lib/parsing_nesting/tree.rb, line 335 def to_query(solr_params) # rescue double-nots to not treat them crazy-like and make the query # more work for Solr than it needs to be with a double-negative. if operand.is_a?(NotExpression) operand.operand.to_query(solr_params) else "NOT " + operand.to_query(solr_params) end end