The relevance/weight doesn't seem to be working as expected in
Sphinx.
I am using the default match mode on Sphinx 0.9.8.1 with Thinking
Sphinx which should be SPH_MATCH_ALL which should have a final weight
as the sum of weighted phrase ranks.
Let's say a Video table had these titles
1) Lost in Space
2) Lost in Translation
3) Lost
A search with the string "lost" will return results seemingly in the
id order, instead of the title "Lost" being first. I try to set the
match mode to phrase, extended, extended2 in the model or controller
and it seem to make no differences as the weight seem to be the same
for all the titles.
Ferret seems to do a better jobs at this type of relevance.
Any ideas how to fix this?
== model ==
class Video < ActiveRecord::Base
define_index do
indexes title, :sortable => true
#set_property :match_mode => :phrase #:extended, :extended2
end
end
== controller ==
@results = Video.search(@query_string)
#...@results = Video.search(@query_string, :match_mode => :phrase)
# :extended, :extended2
== view ==
@results.each_with_weighting do |hit, weight|
puts "#{hit.id} #{weight}"
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---