I'm building a new index from scratch based on a number of documents
stored in a database loaded using my Rails env (using Ruby Ferret 0.9x
(installed today with Gem) on Windows). At first everything goes nice
but after a number of documents it starts to go slower and slower until
it grinds to a halt (at least feels like it).
Am I doing something wrong? Is there some way to work around this?
/Marcus
Code in question:
ENV['RAILS_ENV'] ||= 'development'
puts "Environment : #{ENV['RAILS_ENV']}"
require 'config/environment.rb'
require 'ferret'
index = Ferret::Index::Index.new( :path => Node.class_index_dir, :create
=> true)
Node.find_all_by_type("PageNode").each { |content|
puts "ID: #{content.id} => name: #{content.title}"
index << content.to_doc if content.respond_to?("to_doc")
}
index.flush
index.optimize
index.close
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk