Forum: Ferret Intermittant Ferret Death

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
219771712d088d739c96780f5c8eb323?d=identicon&s=25 David Malin (dmalin)
on 2009-03-09 18:24
Hey All,

I am currently using ferret on multiple models in my application and
have been experiencing issues for the past few months. When searching
for some terms ferret performs fine but when searching for other terms
ferret will return null objects (not really sure why or what is
occuring) and consequently falldown and the Acts_as_ferret plugin seems
to break.

Here is a more in depth overview of my setup.
- Software Version and Deploy Information
Ferret (v0.11.6) + DRB Server
Rails v1.2.6 with a Mongrel Cluster
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-linux]
Redhat Enterprise Linux 5

- Application Specific Information
Several Models setup with acts_as_ferret (all setup with single_index =>
true)
Search is being performed via (ActsAsFerret::find_by_contents(query))
Index is stored in a shared directory symlinked to public/index. Between
deploys index is removed and rake ferret:rebuild_index is called to
rebuild it

Again the issue is sometimes I search for a term and I get no results
without a problem but in other instances searching for a term that I
know exists will cause an the site to fall down. Another piece
of information to this puzzle is that the ferret_rebuild task
occasionally will simply time out and will need to be killed and
restarted (this is called during deploys). Since there seems to only be
a few terms that break the site I assumed that this is an index related
problem. I have been able to successfully remove the index directory and
call rake ferret:rebuild_index when on the box but this issue still
persists.

Here is a relevant stack trace of when the issue occurs.
An exception occurred in the Application:

EXCEPTION:
NoMethodError in search#index

ERROR:
undefined method `[]' for nil:NilClass

[RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/shared_index_class_methods.rb:53:in
`ar_find_by_contents'
[RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/shared_index_class_methods.rb:53:in
`sort!'
[RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/shared_index_class_methods.rb:53:in
`ar_find_by_contents'
[RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/class_methods.rb:288:in
`find_records_lazy_or_not'
[RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/shared_index_class_methods.rb:42:in
`find_by_contents'

Any thoughts, suggestions or ideas would be greatly appreciated. Thanks

-David
This topic is locked and can not be replied to.