# Acts as ferret, make index in /tmp then copy back to avoid N

**URL:** <https://www.ruby-forum.com/t/acts-as-ferret-make-index-in-tmp-then-copy-back-to-avoid-n/104752>\
**Category:** Ferret\
**Created:** [May 22, 2007, 4:31am UTC](https://www.ruby-forum.com/t/acts-as-ferret-make-index-in-tmp-then-copy-back-to-avoid-n/104752 "2007-05-22T04:31:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuart\_Hungerford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@Stuart\_Hungerford](https://www.ruby-forum.com/u/Stuart_Hungerford)\
**Post date:** [May 22, 2007, 4:31am UTC](https://www.ruby-forum.com/t/acts-as-ferret-make-index-in-tmp-then-copy-back-to-avoid-n/104752/1 "2007-05-22T04:31:49Z")

</div>

Hi,

We’re happily using Ferret through acts\_as\_ferret on a Rails website,  
but we have an issue with rebuilding indexes.

The Rails project directories are on an NFS mounted volume and  
running Model.rebuld\_index there seems to take 60-100 times longer  
than it does on a local filesystem (e.g. /tmp).

What we’d like to do is rebuild our indexes in say /tmp, then copy  
them back when done to the NFS volume with the Rails directories.

Is there any simple way to get Model.rebuild\_index to build indexes  
in a different place, or do we need to take another approach?

Thanks in advance,

Stu

–

Stuart Hungerford  
ANUSF Data Intensive Projects

---

<div class="post-metadata">

**Author:** ![Stuart\_Hungerford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@Stuart\_Hungerford](https://www.ruby-forum.com/u/Stuart_Hungerford)\
**Post date:** [May 22, 2007, 11:34am UTC](https://www.ruby-forum.com/t/acts-as-ferret-make-index-in-tmp-then-copy-back-to-avoid-n/104752/2 "2007-05-22T11:34:45Z")

</div>

On Tue, May 22, 2007 at 12:11:36PM +1000, Stuart Hungerford wrote:

> them back when done to the NFS volume with the Rails directories.
> 
> Is there any simple way to get Model.rebuild\_index to build indexes  
> in a different place, or do we need to take another approach?

If you use the DRb server it would be relatively easy since that (at  
least in svn trunk) does index rebuilds in a separate directory  
independent from the current index that is in use for searching.

By default the rebuild directory is named  
RAILS\_ROOT/index/class\_name/rebuild  
should be relatively easy to hack or even make this a configuration  
option.

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
