ActiveRecord::RecordNotFound in search results act_as Ferret

Hello,

I’ve installed the Ferret gem and also got the act_as_ferret code from
the wiki.
I’ve set up my model “Branch” to act as ferret using the code below.

acts_as_ferret :options => {:fields => [‘name’, ‘body_text’, ‘address’]}

I’ve also set up a ferret_controller with the code below

def find
if params[:search_terms]
@branch_results = Branch.find_by_contents(params[:search_terms])
render_text @branch_results.inspect
end
end

I’ve done some updates and the index files seem to be being generated
ok.
If I go to mywebapp/ferret/find?search_terms=gamston where “gamston” is
the name of one of the branches I get

— []

as the result.
If I go to mywebapp/ferret/find?search_terms=* I get

ActiveRecord::RecordNotFound in Ferret#find
Couldn’t find Branch with ID=5

There are no Branches with an ID of 5. Does anyone have any ideas whats
going on with my system. I tried my best to trouble shoot the issue but
to no avail.

Any help is appreciated.
Tom S.

Hi!

On Wed, Mar 15, 2006 at 02:01:56PM +0100, Tom S. wrote:

Hello,

I’ve installed the Ferret gem and also got the act_as_ferret code from
the wiki.
I’ve set up my model “Branch” to act as ferret using the code below.

acts_as_ferret :options => {:fields => [‘name’, ‘body_text’, ‘address’]}

I’d say that must read
acts_as_ferret :fields => [‘name’, ‘body_text’, ‘address’]

What Version of acts_as_ferret are you using ?

You should really use the one from the svn repository as described
there: http://projects.jkraemer.net/acts_as_ferret/
The plugin repository is
svn://projects.jkraemer.net/acts_as_ferret/trunk/plugin/acts_as_ferret

Kasper W. and me are actively working on the plugin there, the Code
in the Wiki is more or less outdated. There also is a small rails
project
utilizing the plugin, under
svn://projects.jkraemer.net/acts_as_ferret/trunk/demo

Jens


webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [email protected]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66

Jens K. wrote:

You should really use the one from the svn repository as described
there: http://projects.jkraemer.net/acts_as_ferret/
The plugin repository is
svn://projects.jkraemer.net/acts_as_ferret/trunk/plugin/acts_as_ferret

Thanks Jens,
I’m having a lot of difficulty connecting to the svn because of our
firewall. Are there any other ways in which the files can be downloaded.

Thanks
Tom

On Wed, Mar 15, 2006 at 02:32:28PM +0100, Tom S. wrote:

Jens K. wrote:

You should really use the one from the svn repository as described
there: http://projects.jkraemer.net/acts_as_ferret/
The plugin repository is
svn://projects.jkraemer.net/acts_as_ferret/trunk/plugin/acts_as_ferret

Thanks Jens,
I’m having a lot of difficulty connecting to the svn because of our
firewall. Are there any other ways in which the files can be downloaded.

I attached an archive containing the current trunk to the wiki front
page at http://projects.jkraemer.net/acts_as_ferret/wiki .

Jens


webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [email protected]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66

Tom S. wrote:

Jens K. wrote:

You should really use the one from the svn repository as described
there: http://projects.jkraemer.net/acts_as_ferret/
The plugin repository is
svn://projects.jkraemer.net/acts_as_ferret/trunk/plugin/acts_as_ferret

Thanks Jens,
I’m having a lot of difficulty connecting to the svn because of our
firewall. Are there any other ways in which the files can be downloaded.

Thanks
Tom

Ignore that, I’ve worked it out now.
http://projects.jkraemer.net/acts_as_ferret/browser/trunk/plugin/acts_as_ferret/lib/acts_as_ferret.rb
Thanks
Tom