Permalink
Browse files

Update to Sphinx rc2.

  • Loading branch information...
1 parent 64e6bcc commit 5145f83a7b27171cd7a6e52b03c54ec906b05176 @evan committed Apr 16, 2008
Showing with 39 additions and 17 deletions.
  1. +2 −0 CHANGELOG
  2. +1 −1 README
  3. +3 −2 vendor/riddle/README
  4. +9 −6 vendor/riddle/lib/riddle.rb
  5. +14 −8 vendor/riddle/lib/riddle/client.rb
  6. +10 −0 vendor/riddle/lib/riddle/client/response.rb
View
@@ -1,4 +1,6 @@
+v1.11. Update to Sphinx 0.9.8-rc2.
+
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.
v1.9.1. Add ultrasphinx:index:merge task for index merging, and a note in DEPLOYMENT_NOTES about how to use it.
View
@@ -14,7 +14,7 @@ If you use this software, please {make a donation}[http://blog.evanweaver.com/do
== Requirements
* MySQL 5.0, or PostgreSQL 8.2
-* Sphinx 0.9.8-rc1
+* Sphinx 0.9.8-rc2
* Rails 2.0.2
More recent versions than listed are usually ok.
@@ -12,7 +12,7 @@ The easiest way to install is to grab the gem (available since 0.9.8r1112 only):
However, if you're so inclined, you can grab sourcecode via subversion. If you
are after a specific release, use the tag as follows:
- svn co http://rails-oceania.googlecode.com/svn/patallan/riddle/tags/0.9.8-rc1 riddle
+ svn co http://rails-oceania.googlecode.com/svn/patallan/riddle/tags/0.9.8-rc2 riddle
Or for the most current, just use trunk:
@@ -25,7 +25,8 @@ Please note that at the time of writing, the following versions are supported (i
* 0.9.8-r985
* 0.9.8-r1065
* 0.9.8-r1112
-* 0.9.8-rc1 (gem version is 0.9.8.1198)
+* 0.9.8-rc1 (gem version: 0.9.8.1198)
+* 0.9.8-rc2 (gem version: 0.9.8.1231)
To get started, just instantiate a Client object:
@@ -9,14 +9,17 @@ class ConnectionError < StandardError #:nodoc:
end
module Version #:nodoc:
- Major = 0
- Minor = 9
- Tiny = 8
+ Major = 0
+ Minor = 9
+ Tiny = 8
# Revision number for RubyForge's sake, taken from what Sphinx
# outputs to the command line.
- Rev = 1198
+ Rev = 1231
+ # Release number to mark my own fixes, beyond feature parity with
+ # Sphinx itself.
+ Release = 0
- String = [Major, Minor, Tiny].join('.') + "rc1"
- GemVersion = [Major, Minor, Tiny, Rev].join('.')
+ String = [Major, Minor, Tiny].join('.') + "rc2"
+ GemVersion = [Major, Minor, Tiny, Rev, Release].join('.')
end
end
@@ -206,14 +206,9 @@ def run
result[:matches] << {:doc => doc, :weight => weight, :index => i, :attributes => {}}
result[:attribute_names].each do |attr|
- case result[:attributes][attr]
- when AttributeTypes[:float]
- result[:matches].last[:attributes][attr] = response.next_float
- when AttributeTypes[:multi]
- result[:matches].last[:attributes][attr] = response.next_int_array
- else
- result[:matches].last[:attributes][attr] = response.next_int
- end
+ result[:matches].last[:attributes][attr] = attribute_from_type(
+ result[:attributes][attr], response
+ )
end
end
@@ -583,5 +578,16 @@ def keywords_message(query, index, return_hits)
message.to_s
end
+
+ def attribute_from_type(type, response)
+ type -= AttributeTypes[:multi] if is_multi = type > AttributeTypes[:multi]
+
+ case type
+ when AttributeTypes[:float]
+ is_multi ? response.next_float_array : response.next_float
+ else
+ is_multi ? response.next_int_array : response.next_int
+ end
+ end
end
end
@@ -65,6 +65,16 @@ def next_int_array
return items
end
+ def next_float_array
+ count = next_int
+ items = []
+ for i in 0...count
+ items << self.next_float
+ end
+
+ return items
+ end
+
# Returns the length of the streamed data
def length
@str.length

0 comments on commit 5145f83

Please sign in to comment.