# Ferret indexing problem through rake tasks

**URL:** <https://www.ruby-forum.com/t/ferret-indexing-problem-through-rake-tasks/110167>\
**Category:** Ferret\
**Created:** [July 23, 2007, 10:07pm UTC](https://www.ruby-forum.com/t/ferret-indexing-problem-through-rake-tasks/110167 "2007-07-23T22:07:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [July 23, 2007, 10:07pm UTC](https://www.ruby-forum.com/t/ferret-indexing-problem-through-rake-tasks/110167/1 "2007-07-23T22:07:06Z")

</div>

I’m having a weird problem. Recently, on all my environments, one of my  
two indexed models is not returning any results to acts\_as\_ferret.  
However, the folder is being created for it and Im not receiving any  
errors.

On my two models, I call the following:

Book.rebuild\_index  
User.rebuild\_index

When I call those commands through either my live app “ruby  
script/server” or through the console “ruby script/console,” it works  
fine and I can search on the Book model.

However, when I run those exact commands through a rake task (with  
:environment set), it creates the indexes successfully, but it will  
return NO results for the Book model. However, User will continue to  
work. Looking in the log files, it shows that the rebuilds were  
successful. Im guessing there is some kind of linking problems here.

Anyone have any suggestions?

Thanks in advance. - Aryk

---

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [July 26, 2007, 12:45am UTC](https://www.ruby-forum.com/t/ferret-indexing-problem-through-rake-tasks/110167/2 "2007-07-26T00:45:46Z")

</div>

Hi!

On Mon, Jul 23, 2007 at 10:07:06PM +0200, Aryk G. wrote:

> I’m having a weird problem. Recently, on all my environments, one of my  
> two indexed models is not returning any results to acts\_as\_ferret.  
> However, the folder is being created for it and Im not receiving any  
> errors.

Did you change anything in your setup before this started happening  
(maybe an aaf upgrade)? What version of aaf do you use?

> :environment set), it creates the indexes successfully, but it will  
> return NO results for the Book model. However, User will continue to  
> work. Looking in the log files, it shows that the rebuilds were  
> successful. Im guessing there is some kind of linking problems here.

When you say aaf creates the indexes successfully, does that mean that  
you checked them with plain Ferret and could retrieve documents from the  
books index?

cheers,  
Jens

–  
Jens Krämer  
webit! Gesellschaft für neue Medien mbH  
Schnorrstraße 76 | 01069 Dresden  
Telefon +49 351 46766-0 | Telefax +49 351 46766-66  
removed\_email\_address@domain.invalid | [www.webit.de](http://www.webit.de)

Amtsgericht Dresden | HRB 15422  
GF Sven Haubold, Hagen Malessa
