Nathaniel, thanks for the info. I will await the bug fix. In the 
meantime my own workaround looks like this. In my QueryParser subclass, 
I override parse() so that it filters out stopwords first:

class SafeQueryParser < Ferret::QueryParser

  def initialize(default_field, options)
    my_options = { :analyzer => Ferret::Analysis::StandardAnalyzer.new 
}.update(options)
    super(default_field, my_options)
    # breaking encapsulation here, but whaddya gonna do...
    @stop_words = 
my_options[:analyzer].instance_variable_get(:@stop_words)
  end

  def parse(query)
        @stop_words.each do |word|
                query.gsub!(/\b#{word}\b\s*/, '')
        end
        super(query)
  end

end

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to