Permalink
Browse files

Relevance is the sort mode.

Whack but @relevance is listed as an alias for @weight in the extended
sort mode.
  • Loading branch information...
shanna committed May 25, 2010
1 parent 7c9fea1 commit 7d0077f5589f1e6b2513ee1c8deecb135a7577e6
View
@@ -12,6 +12,6 @@
require 'dm-sphinx-adapter/search/match/extended2'
require 'dm-sphinx-adapter/search/match/phrase'
require 'dm-sphinx-adapter/search/sort/extended'
-require 'dm-sphinx-adapter/search/sort/rank'
+require 'dm-sphinx-adapter/search/sort/relevance'
require 'dm-sphinx-adapter/adapter'
@@ -26,7 +26,7 @@ def initialize repository, model, options = {}
when :boolean then Search::Match::Boolean.new(self)
else raise ArgumentError, "+options[:mode]+ used an unknown mode #{mode.inspect}."
end
- sort = order.size == 0 ? Search::Sort::Rank.new(self) : Search::Sort::Extended.new(self)
+ sort = order.size == 0 ? Search::Sort::Relevance.new(self) : Search::Sort::Extended.new(self)
@search = Search.new(match, filter, sort)
end
end # Query
@@ -4,15 +4,15 @@ module DataMapper
module Sphinx
class Search
module Sort
- class Rank < Statement
+ class Relevance < Statement
def mode
- :rank
+ :relevance
end
def statement
''
end
- end # Rank
+ end # Relevance
end # Sort
end # Search
end # Sphinx
View
@@ -32,7 +32,7 @@
raise %{Re-create index failed:\n #{indexer}} if indexer =~ /error|fatal/i
sleep 1
-DataMapper::Logger.new($stdout, :debug)
+# DataMapper::Logger.new($stdout, :debug)
DataMapper.setup(:default, :adapter => 'sphinx')
# Use DM shared spec model cleanup code.

0 comments on commit 7d0077f

Please sign in to comment.