# Ferret and capistrano, how to keep the indexes?

**URL:** <https://www.ruby-forum.com/t/ferret-and-capistrano-how-to-keep-the-indexes/106944>\
**Category:** Ferret\
**Created:** [June 15, 2007, 3:21pm UTC](https://www.ruby-forum.com/t/ferret-and-capistrano-how-to-keep-the-indexes/106944 "2007-06-15T15:21:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [June 15, 2007, 3:21pm UTC](https://www.ruby-forum.com/t/ferret-and-capistrano-how-to-keep-the-indexes/106944/1 "2007-06-15T15:21:46Z")

</div>

Hi, i’m using capistrano to deploy the application, but every time i  
deploy it change all the directory, so i lost also the ferret’s indexes.  
Is it possible to keep them in order to prevent the reindex on each  
deploy?

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [June 15, 2007, 4:36pm UTC](https://www.ruby-forum.com/t/ferret-and-capistrano-how-to-keep-the-indexes/106944/2 "2007-06-15T16:36:08Z")

</div>

> sure, put the ferret index directory in the capistrano shared directory,  
> and have capistrano symlink it in. The same way the log/ and tmp/  
> directories are handled.

Example:  
In my deploy.rb file, I added (edited) :

desc “Set up the shared index”  
task :after\_setup, :roles =\> [:app, :web] do  
run “mkdir -p -m 777 #{shared\_path}/index”  
end

desc “symlink the index”  
task :after\_update, :roles =\> [:app, :web] do  
run “ln -nfs #{shared\_path}/index #{current\_release}/index”  
end

Alain

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [June 15, 2007, 3:33pm UTC](https://www.ruby-forum.com/t/ferret-and-capistrano-how-to-keep-the-indexes/106944/3 "2007-06-15T15:33:00Z")

</div>

sure, put the ferret index directory in the capistrano shared directory,  
and have capistrano symlink it in. The same way the log/ and tmp/  
directories are handled.

John.

On Fri, 2007-06-15 at 15:21 +0200, mike wrote:

> Hi, i’m using capistrano to deploy the application, but every time i  
> deploy it change all the directory, so i lost also the ferret’s indexes.  
> Is it possible to keep them in order to prevent the reindex on each  
> deploy?

–  
[http://johnleach.co.uk](http://johnleach.co.uk)
