I'd like to get the following behavior:

1.  Stemming.  The search is on a database of summaries of California legal
cases.  Things like a search for "thermal image" needs to hit "thermal
imaging."

2.  Stop words.  Searches for "failing to instruct the jury" should come up
with hits on a search for "fail to instruct."

3.  Case-insensitive.

What I tried was:

class StemmedAnalyzer < Ferret::Analysis::Analyzer
  def token_stream(field, reader)
    return
Ferret::Analysis::PorterStemFilter.new(Ferret::Analysis::LowerCaseTokenizer.
new(reader))
  end
end

class Summary < ActiveRecord::Base
  acts_as_ferret(:analyzer => StemmedAnalyzer.new)

But this doesn't appear to give me either stemming or stopwords.  It does
give me basic searching (searches for exact keywords without stopwords work,
searches with stopwords return no results).

I've looked through the archives, and I'm still confused.  Suggestions?

 - James Moore

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

Reply via email to