David Balmain wrote:
> On 9/6/06, Alastair Moore <[EMAIL PROTECTED]> wrote:
>> Alastair
> The default analyzer doesn't perform any stemming. You need to create
> your own analyzer with a stemmer. Something like this;
>
> require 'rubygems'
> require 'ferret'
>
> module Ferret::Analysis
> class MyAnalyzer
> def token_stream(field, text)
> StemFilter.new(StandardTokenizer.new(text))
> end
> end
> end
>
> index = Ferret::I.new(:analyzer => Ferret::Analysis::MyAnalyzer.new)
>
> index << "test"
> index << "tests debate debater debating the for,"
> puts index.search("test").total_hits
>
> Hope that helps,
> Dave
Hi Dave,
Many thanks for the help, it does help! However given the short timespan
for this project, I think the users of the site will just have to be a
bit more specific in their search terms :) Cheers and will bookmark your
reply for a later project.
Alastair
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk