I came to a situation where I needed to search my Active record, but I did not know which field contains the information. The solution with Ferret was just three steps away… Let’s say, you want to search Stories for ‘Giant’ keyword. You have to create a Ferret index in memory (ferret gem needs to… Continue reading Ad-hoc fulltext search in RoR ActiveRecord
Tag: ferret
acts_as_ferret tip: uninitialized constant Ferret::Index::FieldInfos
I have upgraded acts_as_ferret plugin to the latest version and my fulltext search stopped searching. It was throwing an error message: NameError (uninitialized constant Ferret::Index::FieldInfos): /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:263:in `load_missing_constant’ /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in `const_missing’ .//vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:119:in `field_infos’ .//vendor/plugins/acts_as_ferret/lib/local_index.rb:58:in `rebuild_index’ .//vendor/plugins/acts_as_ferret/lib/local_index.rb:37:in `ensure_index_exists’ .//vendor/plugins/acts_as_ferret/lib/local_index.rb:9:in `initialize’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:304:in `new’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:304:in `create_index_instance’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:55:in `aaf_index’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:120:in `find_id_by_contents’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:176:in `ar_find_by_contents’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:170:in `find_records_lazy_or_not’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:86:in `find_by_contents’ If you observe the… Continue reading acts_as_ferret tip: uninitialized constant Ferret::Index::FieldInfos
Full text search in Ruby on Rails 3 – ferret
There are several possibilities how to use ferret in RoR. This post will show the easy way – using the acts_as_ferret plugin. To show the syntax and code, I will use the same data objects as in the Full text search in ruby on rails 2 – MySQL Installation Ferret installation is easy gem install… Continue reading Full text search in Ruby on Rails 3 – ferret