Hi, David and everyone,
I’ve had Ferret running fine in a production Rails application for a
while now. I haven’t updated Ferret or really looked at the
Ferret-related code since probably January, but I recently started
thinking about trying out the latest version (we were using 0.3.2, I
think). I got the latest (0.9.4) and have noticed things break. In
particular, I used to refer to the constant
Ferret::Analysis::StandardAnalyzer::ENGLISH_STOP_WORDS, but now when I
try to reference it I get an uninitialized constant error for
StopAnalyzer. Here’s an example IRB session:
1 irb(main):001:0> require 'rubygems' 2 => true 3 irb(main):002:0> require_gem 'ferret' 4 => true 5 irb(main):003:0> Ferret::Analysis::StopAnalyzer 6 NameError: uninitialized constant Ferret 7 from (irb):3 8 irb(main):004:0> require 'ferret' 9 => true 10 irb(main):005:0> Ferret::Analysis::StopAnalyzer 11 NameError: uninitialized constant Ferret::Analysis::StopAnalyzer 12 from (irb):5 13 irb(main):006:0> Ferret::Analysis::StandardAnalyzer 14 => Ferret::Analysis::StandardAnalyzer 15 irb(main):007:0> Ferret::Analysis::StandardAnalyzer.superclass 16 => Ferret::Analysis::Analyzer
A few questions:
On line 8 – why is it necessary to require ‘ferret’ after doing a
On lines 10 and 11 – why isn’t it finding StopAnalyzer? It’s defined in
the same file as StandardAnalyzer (lines 13 and 14).
On lines 15 and 16 – StandardAnalyzer is defined in
ferret-0.9.4/lib/ferret/analysis/analyzers.rb, and it’s a subclass of
StopAnalyzer. Yet when I try the superclass method, it returns Analyzer.
Any ideas why this is?
Maybe I’m missing something really obvious, but I’m finding it quite
perplexing right now.
P.S. David – thanks for Ferret! It’s been running great in our
production application. People love the app’s search capabilities,
including fuzzy search, which are of course all made possible by Ferret.