Hi,
I have some code to rebuild my ferret indexes but occasionally some
stale documents remain in the index even after rebuilding. The only
way I could find around this is to manually delete the index files
from the filesystem. Here is the code I have for rebuilding one of my
indexes for Gifts:
# delete existing entries
INDEX.size.times {|i| INDEX.delete(i)}
gifts = Gift.find(:all)
if (gifts)
gifts.each do |e|
INDEX << self.to_doc
end
end
INDEX.flush()
Does this look ok? I have verified this behavior on Ferret 0.3.2 and
0.9 on windows.
Thanks,
Tom Davies
http://blog.atomgiant.com
http://gifthat.com
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk