On 9/10/06, Kent Sibilev <[EMAIL PROTECTED]> wrote:
> Is there a way to add per-field analyzer? I can't seem to find a way to do 
> that.
>
> Thanks
>
> --
> Kent

Hi Kent,

I'm not sure if you mean add *to* a PerFieldAnalyzer or add a
PerFieldAnalyzer to and Index. Here is how you do both;

    include Ferret::Analysis
    pfa = PerFieldAnalyzer.new(StandardAnalyzer.new())
    pfa['white'] = WhiteSpaceAnalyzer.new(false)
    pfa['white_l'] = WhiteSpaceAnalyzer.new(true)
    pfa['letter'] = LetterAnalyzer.new(false)
    pfa.add_field('letter', LetterAnalyzer.new(true))
    pfa.add_field('letter_u', LetterAnalyzer.new(false))

    index = Ferret::Index::Index.new(:analyzer => pfa)

I hope that's what you were asking.

Dave
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to