80a81,83
>         # After OPTIMIZE_COUNT insertions, ferret will optimize the index.
>         OPTIMIZE_COUNT = 100
>         
85a89,95
>             # Optimize the index once in a while. 
>             # Assuming that id is an auto generated, 1 by 1 increasing integer.
>             id_num = self.id.to_i
>             if not id_num.zero? and id_num.modulo(OPTIMIZE_COUNT).zero?
>               logger.debug "ferret_create/update: #{self.class.name} : #{self.id}. Optimizing ferret index."
>               self.class.ferret_index.optimize
>             end
