Hi Tony

I'm not sure what the better way of doing this is, but my  
understanding of the :all match_mode (and :any, possibly :boolean) is  
that there's no relevance scoring - anything that matches gets a score  
of 1, and beyond that, results are returned in document id order  
(which is the same as database order).

 From what the docs suggest about the ranking engines, it sounds like  
it should work with extended2 (and the default ranking engine BM25):
http://www.sphinxsearch.com/docs/manual-0.9.8.html#api-func-setrankingmode

Sorry I can't provide any definitive answers for this problem.

-- 
Pat

On 02/09/2009, at 1:41 AM, Tony C wrote:

>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to