Hi
Best approach here is to have multiple indexes for each model, one per language:
[:en, :fr].each do |lang|
define_index("#{name}_#{lang}") do
indexes column # etc
set_property :morphology => "stem_#{lang}"
end
end
Then, in searching, you'll need to specify the indices you want:
Model.search "foo", :index => 'model_en_core'
If you're also using delta indexes, then you'll want to use both _core and
_delta:
Model.search "foo", :index => 'model_en_core,model_en_delta'
Give this a spin, it or something like it should do the trick.
Cheers
--
Pat
On 29/03/2011, at 7:13 AM, hydrozen wrote:
> Hi,
>
> my rails app is available in english and french. If I want to activate
> the stemmer in morphology, how can it be possible for me to switch
> between the french stemmer and english stemmer? Is there a way to
> change that at runtime?
>
> --
> 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.