Take the 2008 Git User's Survey and help out! [ hide ]

public
Fork of DrMark/ultrasphinx
Description: a maintained fork of Evan Weaver's Ultrasphinx code -- see the escape_sql branch
Homepage: http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/files/README.html
Clone URL: git://github.com/github/ultrasphinx.git
Search Repo:
Update to Sphinx rc2.


git-svn-id: svn://rubyforge.org/var/svn/fauna/ultrasphinx/trunk@1925 
c1ad287d-65d5-445d-b84c-e64f8492f1e6
evanweaver (author)
Wed Apr 16 06:48:06 -0700 2008
commit  760b7d1c3be6d4271c15e831624247e69bb04e4d
tree    0001a2b0c8eceb2c2fdcf429dc55322743126d99
parent  f5ec50e4191657d9c18a3ab52208314892aadd70
...
1
 
 
2
3
4
...
1
2
3
4
5
6
0
@@ -1,4 +1,6 @@
0
 
0
+v1.11. Update to Sphinx 0.9.8-rc2.
0
+
0
 v1.10. Add geodistance support (Jeremy Seitz, Mark Lane). Move Postgres stored procedures into a migration generator (Lang Riley). Duplicate text :sortable columns so that they are also searchable.
0
 
0
 v1.9.1. Add ultrasphinx:index:merge task for index merging, and a note in DEPLOYMENT_NOTES about how to use it.
0
...
14
15
16
17
 
18
19
20
...
14
15
16
 
17
18
19
20
0
@@ -14,7 +14,7 @@ If you use this software, please {make a donation}[http://blog.evanweaver.com/do
0
 == Requirements
0
 
0
 * MySQL 5.0, or PostgreSQL 8.2
0
-* Sphinx 0.9.8-rc1
0
+* Sphinx 0.9.8-rc2
0
 * Rails 2.0.2
0
 
0
 More recent versions than listed are usually ok.
...
12
13
14
15
 
16
17
18
...
25
26
27
28
 
 
29
30
31
...
12
13
14
 
15
16
17
18
...
25
26
27
 
28
29
30
31
32
0
@@ -12,7 +12,7 @@ The easiest way to install is to grab the gem (available since 0.9.8r1112 only):
0
 However, if you're so inclined, you can grab sourcecode via subversion. If you
0
 are after a specific release, use the tag as follows:
0
 
0
- svn co http://rails-oceania.googlecode.com/svn/patallan/riddle/tags/0.9.8-rc1 riddle
0
+ svn co http://rails-oceania.googlecode.com/svn/patallan/riddle/tags/0.9.8-rc2 riddle
0
 
0
 Or for the most current, just use trunk:
0
 
0
@@ -25,7 +25,8 @@ Please note that at the time of writing, the following versions are supported (i
0
 * 0.9.8-r985
0
 * 0.9.8-r1065
0
 * 0.9.8-r1112
0
-* 0.9.8-rc1 (gem version is 0.9.8.1198)
0
+* 0.9.8-rc1 (gem version: 0.9.8.1198)
0
+* 0.9.8-rc2 (gem version: 0.9.8.1231)
0
 
0
 To get started, just instantiate a Client object:
0
 
...
9
10
11
12
13
14
 
 
 
15
16
17
 
 
 
 
18
19
20
 
 
21
22
23
...
9
10
11
 
 
 
12
13
14
15
16
 
17
18
19
20
21
 
 
22
23
24
25
26
0
@@ -9,14 +9,17 @@ module Riddle #:nodoc:
0
   end
0
   
0
   module Version #:nodoc:
0
- Major = 0
0
- Minor = 9
0
- Tiny = 8
0
+ Major = 0
0
+ Minor = 9
0
+ Tiny = 8
0
     # Revision number for RubyForge's sake, taken from what Sphinx
0
     # outputs to the command line.
0
- Rev = 1198
0
+ Rev = 1231
0
+ # Release number to mark my own fixes, beyond feature parity with
0
+ # Sphinx itself.
0
+ Release = 0
0
     
0
- String = [Major, Minor, Tiny].join('.') + "rc1"
0
- GemVersion = [Major, Minor, Tiny, Rev].join('.')
0
+ String = [Major, Minor, Tiny].join('.') + "rc2"
0
+ GemVersion = [Major, Minor, Tiny, Rev, Release].join('.')
0
   end
0
 end
0
\ No newline at end of file
...
206
207
208
209
210
211
212
213
214
215
216
 
 
 
217
218
219
...
583
584
585
 
 
 
 
 
 
 
 
 
 
 
586
587
...
206
207
208
 
 
 
 
 
 
 
 
209
210
211
212
213
214
...
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
0
@@ -206,14 +206,9 @@ module Riddle
0
 
0
           result[:matches] << {:doc => doc, :weight => weight, :index => i, :attributes => {}}
0
           result[:attribute_names].each do |attr|
0
- case result[:attributes][attr]
0
- when AttributeTypes[:float]
0
- result[:matches].last[:attributes][attr] = response.next_float
0
- when AttributeTypes[:multi]
0
- result[:matches].last[:attributes][attr] = response.next_int_array
0
- else
0
- result[:matches].last[:attributes][attr] = response.next_int
0
- end
0
+ result[:matches].last[:attributes][attr] = attribute_from_type(
0
+ result[:attributes][attr], response
0
+ )
0
           end
0
         end
0
 
0
@@ -583,5 +578,16 @@ module Riddle
0
       
0
       message.to_s
0
     end
0
+
0
+ def attribute_from_type(type, response)
0
+ type -= AttributeTypes[:multi] if is_multi = type > AttributeTypes[:multi]
0
+
0
+ case type
0
+ when AttributeTypes[:float]
0
+ is_multi ? response.next_float_array : response.next_float
0
+ else
0
+ is_multi ? response.next_int_array : response.next_int
0
+ end
0
+ end
0
   end
0
 end
...
65
66
67
 
 
 
 
 
 
 
 
 
 
68
69
70
...
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
0
@@ -65,6 +65,16 @@ module Riddle
0
         return items
0
       end
0
       
0
+ def next_float_array
0
+ count = next_int
0
+ items = []
0
+ for i in 0...count
0
+ items << self.next_float
0
+ end
0
+
0
+ return items
0
+ end
0
+
0
       # Returns the length of the streamed data
0
       def length
0
         @str.length

Comments

    No one has commented yet.