Hi Jeff
You can use the set_property method within a define_index block to set
morphologies there⦠so your idea of two indices per model should work fine:
define_index 'model_standard' do
# fields, attributes
end
define_index 'model_metaphone' do
# fields, attributes
set_property :morphology => 'metaphone'
end
Make sure you remove the morphology setting from your sphinx.yml file,
otherwise it'll be the default in indices that don't specify a morphology
setting.
Also, with this setup, you could weight the standard indices over the
metaphoned ones - but note that indices have _core appended to their names (and
_delta equivalents if you're using deltas).
Cheers
--
Pat
On 22/05/2012, at 4:03 PM, Jeff wrote:
> Hello,
>
> I am using Thinking Sphinx to search for names in several models, and
> in sphinx.yml I have set the morphology as metaphone, because I want
> there to be a certain 'fuzziness' to the search results that match.
> However, I still want exact matches to be weighted higher than inexact
> matches. For example, with metaphone on, the search 'pereta' returns
> both 'boriti' and 'pereta' and they are ranked the same, whereas of
> course I want 'pereta' to rank higher than 'boriti'.
>
> I've looked all over for an answer to this, and it seems that Sphinx
> doesn't have any way of ranking closer matches higher than others. So
> my best guess is to somehow have two indexes, one which indexes
> without morphology and one that indexes with metaphone - then combine
> the results programatically. However, as far as I understand, it
> seems that the morphology is set only once, and that's in the
> sphinx.yml file - and I can't set different morphologies for different
> indexes. Am I right about this? Is there any way to apply different
> morphologies to different indexes?
>
> Thanks much,
> Jeff
>
> --
> 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.