Hey guys,
Since this was a pretty easy fix, I've fixed it in the pure ruby
version. You'll have to get it out of the subversion repo if you want
it.
Cheers,
Dave
On 4/15/06, roop <[EMAIL PROTECTED]> wrote:
> 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
>
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk