Topic: acts_as_ferret not working at all

So, I'm attempting to use acts_as_ferret (the plugin), but it doesn't work as expected at all. For starters, the method "find_by_contents" gives me a "NoMethod" error. But even if I use "find_with_ferret" and the like I get no results!

Everything is set up correctly, I'm actually trying this with a fresh test app, no other plugins getting in the way, and it's not working.

I'm guessing because this is a dev environment and I don't have the ferret server running, but I didn't think that was a hard dependency just for testing...

Any thoughts?

Thanks.

Re: acts_as_ferret not working at all

Ok, so, the problem seems to be a problem with STI and acts_as_ferret.  Should I be using this differently when I'm trying to search from the parent class in STI?

class ***** < ActiveRecord::Base
  acts_as_ferret
# ferret search returns no results
end

class Implant < *****
# ferret search works
end

class Natural < *****
# ferret search works
end

Re: acts_as_ferret not working at all

alrighty, so if anyone else has this problem, the tutorials, and info on the net, and the rdocs seem to be wrong for the current version of the acts_as_ferret plugin.

Model.find_with_ferret(q, options = {}, find_options = {}) # is find_by_contents  
Model.find_ids_with_ferret(q, options = {}, &block) # is find_id_by_contents and also id_multi_search

the "find_ids_with_ferret" method will include your STI models if you do it from the parent Class.   If you want to use only certain models from subclasses you can just specify them using the ":models" option.