style: find_id_by_contents now accepts a block
[acts_as_ferret.git] / rebuild_index.rb
blob23877fd9e3ffc53c76cd65056986af1fc8285d9d
1 require 'ferret'
3 index = Ferret::Index::Index.new( :path => Content.class_index_dir,
4                                                                                                                                         :create => true
5                                                                                                                                 )
6 Content.find_all.each { |content| index << content.to_doc }
7 index.flush
8 index.optimize
9 index.close