# When does ferret / AAF decide to reindex?

**URL:** <https://www.ruby-forum.com/t/when-does-ferret-aaf-decide-to-reindex/105409>\
**Category:** Ferret\
**Created:** [May 29, 2007, 7:19pm UTC](https://www.ruby-forum.com/t/when-does-ferret-aaf-decide-to-reindex/105409 "2007-05-29T19:19:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [May 29, 2007, 7:19pm UTC](https://www.ruby-forum.com/t/when-does-ferret-aaf-decide-to-reindex/105409/1 "2007-05-29T19:19:07Z")

</div>

I am experience situations where accessing the index results in a  
complete re-indexing of the model. I have not been able to detect a  
pattern.

Under what circumstances does Ferret (or AAF) decide that it needs to  
rebuild the index? I’ll be happy to look at the code relevant to this  
if someone could direct me to it.

Thanks,  
John

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [May 30, 2007, 5:35am UTC](https://www.ruby-forum.com/t/when-does-ferret-aaf-decide-to-reindex/105409/2 "2007-05-30T05:35:16Z")

</div>

I’m fairly certain that a complete re-index only occurs when either a)  
the index can’t be found at the given ‘index\_dir’, or b)  
Model.rebuild\_index is called.  
The code I looked at was in ClassMethods#aaf\_index which, if you follow  
it into ‘create\_index\_instance’, does index on creation. Hopefully that  
can at least put you on the track to debugging your problem.

Matt
