Hi Shaun

You're not the first person to be looking for exact matches in a field taking 
priority over other fields, but I'm not sure if this is possible in Sphinx. 
It's probably worth asking about this on the Sphinx forum instead, because it's 
definitely beyond my knowledge, and it's not tied to Ruby/Thinking Sphinx.
http://www.sphinxsearch.com/forum/

Sorry I can't be more help at the moment.

-- 
Pat

On 13/01/2010, at 1:24 PM, Shaun wrote:

> Hi
> 
> I have indexed two fields from my database, a title and author. I have
> put more field weight on the title field. Title => 20, Author => 18.
> There are a few other fields in the index for which I have not changed
> the field weight.
> 
> My problem is that if I search for a word that appears WITHIN both the
> title and the author field and also appears as an exact match in one
> of the fields, the document that has the field in both fields displays
> first.
> 
> In my example, I am searching for a one word title. There is an exact
> match in the index (i.e there is a record with a title matching that
> exact word) but documents that do not have an exact match but rather
> contain the search word in more than one field display first.
> 
> Is there a way to force exact matches to display before documents with
> multiple field matches?
> 
> If I have a record with a Title of 'Sphinx' and a random Author plus
> another record with Title of 'Check out the Sphinx Search Engine' and
> an Author of 'Mr A. B Sphinx', the second record will always display
> first, whereas, because the first record contains an exact match, I
> need it to display first. I have played with field weights to no avail
> and changing rank_mode seems to have little effect.
> 
> I was beginning to wonder whether I need to refresh something if I
> change the code in my controller (I am setting field_weight and
> rank_mode on the fly within my controller) as changes to both
> weighting and rank_mode seem to have little effect. Maybe something is
> getting cached somewhere?
> 
> Any insight would be greatly appreciated!
> 
> Many thanks
> 
> Shaun
> -- 
> 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.
> 
> 

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