# Rebuild the indices

**URL:** <https://www.ruby-forum.com/t/rebuild-the-indices/128052>\
**Category:** Ferret\
**Created:** [February 4, 2008, 5:13pm UTC](https://www.ruby-forum.com/t/rebuild-the-indices/128052 "2008-02-04T17:13:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flnative](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/5daacb/32.png) [@flnative](https://www.ruby-forum.com/u/flnative)\
**Post date:** [February 4, 2008, 5:13pm UTC](https://www.ruby-forum.com/t/rebuild-the-indices/128052/1 "2008-02-04T17:13:41Z")

</div>

Hi @ all  
How can I rebuild the index without blocking the whole app? Now I use in  
the controller the Model.rebuild\_index method. When I start this method,  
the app is blocking at this time until the new index is built.

How can I automate the process to rebuild the index every day for  
example? Can I use a cron-job and a rubyscript to do this?

thanks for helping!

---

<div class="post-metadata">

**Author:** ![flnative](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/5daacb/32.png) [@flnative](https://www.ruby-forum.com/u/flnative)\
**Post date:** [February 14, 2008, 10:54pm UTC](https://www.ruby-forum.com/t/rebuild-the-indices/128052/2 "2008-02-14T22:54:38Z")

</div>

K. R. wrote:

> How can I automate the process to rebuild the index every day for  
> example? Can I use a cron-job and a rubyscript to do this?
> 
> thanks for helping!

i’ve done this sort of thing with a windows scheduled task (similar to a  
cron job) that calls a batch file which executes a ruby program. guess  
you would want to delete the index first and then do a find all on all  
the records you wanted to reindex.
