public
Description: Ambition adapter for Sphinx
Clone URL: git://github.com/technicalpickles/ambitious-sphinx.git
Added rdoc for AmbitiousSphinx::Base.
Mon Feb 18 13:28:02 -0800 2008
commit  5daac3847bdd94de713dad1adf5db111b4d79417
tree    a118726018390e96a49f23ff3a51a999f237cb88
parent  3853078d15777ca4765162c3287908ccc199406e
...
1
2
3
 
4
 
 
 
 
5
6
7
8
 
9
10
11
12
 
 
13
14
15
16
 
17
18
19
...
1
2
 
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
0
@@ -1,19 +1,27 @@
0
 module Ambition #:nodoc:
0
   module Adapters #:nodoc:
0
- module AmbitiousSphinx
0
+ module AmbitiousSphinx #:nodoc:
0
       class Base
0
+ # Does the string contain a field (in terms of Ultrasphinx's querying).
0
+ # This is basically checking for a colon. Typically, you'd see something like:
0
+ #
0
+ # name:"some search terms"
0
         def has_field? str
0
           str =~ /:/
0
         end
0
         
0
+ # Does the string contain a query operator? This includes AND, OR, and NOT.
0
         def has_operator? str
0
           str =~ /(AND|OR|NOT)/
0
         end
0
         
0
+ # Does the string need to be quoted? It needs to be quoted unless it doesn't
0
+ # have an operator or field.
0
         def needs_quoting? str
0
           not (has_operator?(str) or has_field?(str))
0
         end
0
         
0
+ # Add quotes to the string if it needs it.
0
         def quotify str
0
           if needs_quoting?(str)
0
             %Q("#{str}")

Comments

    No one has commented yet.