Andreas Korth wrote: > Hi Caspar, > > On 27.10.2006, at 11:58, Ghost wrote: > >> NameError: uninitialized constant MyAnalyzer > Sorry, I forgot to mention that the directory structure needs to > resemble the module nesting, i.e. the file must go in app/models/ > ferret/analysis instead of just app/models. > > Cheers, > Andy
I've been trying to use the solution for stemming discussed in this thread and have run into a bit of trouble. I'm using this analyzer: module Ferret::Analysis class StemmingAnalyzer def token_stream(field, text) StemFilter.new(StandardTokenizer.new(text)) end end end I've configured aaf thusly: AAF_DEFAULT_FERRET_OPTIONS = {:analyzer => Ferret::Analysis::StemmingAnalyzer.new} acts_as_ferret({:store_class_name => true, :fields => {:description => {:store => :yes}}}.merge(AAF_DEFAULT_OPTIONS), AAF_DEFAULT_FERRET_OPTIONS) The first time I search for something a new index is created in index, and it successfully returns a set of results. The second time I search, however, I get a strange error: uninitialized constant Ferret::Search #{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/dependencies.rb:264:in `load_missing_constant' #{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/dependencies.rb:453:in `const_missing' #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/local_index.rb:160:in `query_for_record' #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/local_index.rb:152:in `document_number' #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/local_index.rb:135:in `highlight' /opt/local/lib/ruby/1.8/monitor.rb:238:in `synchronize' #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/local_index.rb:134:in `highlight' #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/instance_methods.rb:30:in `highlight' Perhaps it has something to do with loading an already created index? Thanks, -Adam -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ferret-talk mailing list Ferret-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/ferret-talk