0
@@ -2,7 +2,7 @@ module Ambition
0
# Select is responsible for taking pure Ruby, and mangling it until it resembles
0
- # the syntax that Ultra
Sphinx[http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/files/README.html] uses.
0
+ # the syntax that Ultra
sphinx[http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/files/README.html] uses.
0
@@ -10,30 +10,25 @@ module Ambition
0
- # chained calls not supported
0
+ # Should we be supporting chained calls like:
0
+ # I don't think Sphinx would be able to handle this.
0
def chained_call(*methods)
0
- # An idiom here is to call the chained method and pass it
0
- # if respond_to? methods[1]
0
- # send(methods[1], methods[0])
0
- # In the above example, this translates to calling:
0
raise "Not implemented yet."
0
- # Handles generating an Ultra
Sphinx query for code like:
0
+ # Handles generating an Ultra
sphinx query for code like:
0
"#{quotify left} AND #{quotify right}"
0
- # Handles generating an Ultra
Sphinx query for code like:
0
+ # Handles generating an Ultra
sphinx query for code like:
0
def either(left, right)
0
@@ -50,42 +45,59 @@ module Ambition
0
raise "Not applicable to sphinx."
0
- # >> select { |u| u.name =~ 'chris' }
0
- # => #=~( call(:name), 'chris' )
0
+ # Handles generating an Ultrasphinx query for code like:
0
+ # * left hand side _must_ be a field, like u.name
0
+ # * right hand side _must not_ be a regular expression. Pattern matching is generally not
0
+ # supported by full text search engines
0
raise if right.is_a? Regexp
0
"#{left}#{quotify right}"
0
- # >> select { |u| u.name !~ 'chris' }
0
- # => #not_regexp( call(:name), 'chris' )
0
+ # Handles generating an Ultrasphinx query for code like:
0
+ # * left hand side _must_ be a field, like u.name
0
+ # * right hand side _must not_ be a regular expression. Pattern matching is generally not
0
+ # supported by full text search engines
0
def not_regexp(left, right)
0
# could be DRYer, but this is more readable than: "NOT #{self.=~(left,right)}"
0
raise if right.is_a? Regexp
0
"NOT #{left}#{quotify right}"
0
+ # Not supported by Sphinx. If you need this kind of comparison, you probably should be
0
+ # using ambitious-activerecord.
0
raise "Not applicable to sphinx."
0
+ # Not supported by Sphinx. If you need this kind of comparison, you probably should be
0
+ # using ambitious-activerecord.
0
raise "Not applicable to sphinx."
0
+ # Not supported by Sphinx. If you need this kind of comparison, you probably should be
0
+ # using ambitious-activerecord.
0
raise "Not applicable to sphinx."
0
+ # Not supported by Sphinx. If you need this kind of comparison, you probably should be
0
+ # using ambitious-activerecord.
0
raise "Not applicable to sphinx."
0
- # >> select { |u| [1, 2, 3].include? u.id }
0
- # => #include?( [1, 2, 3], call(:id) )
0
+ # Not supported by Sphinx. If you need this kind of comparison, you probably should be
0
+ # using ambitious-activerecord.
0
def include?(left, right)
0
raise "Not applicable to sphinx."
Comments
No one has commented yet.