Sunday, June 28, 2009

acts_as_solr problems

acts_as_solr from railsfreaks is a great plugin, but its not updated for quite sometime. you might few problems like

1) solr:stop doesn't work in Linux/Debian (you might be getting: Solr is not running. I haven't done anything)
2) solr:start doesn't work in Windows
3) Re-indexing solr


If you like to use this plugin then get it from look's fork from

http://github.com/look/acts_as_solr/tree/master

for windows, update the following line at solr.rake (under vendor\plugins\acts_as_solr\lib\tasks)

desc 'Starts Solr. on windows . Options accepted: RAILS_ENV=your_env, PORT=XX. Defaults to development if none.'
task :start_win do
require "#{File.dirname(__FILE__)}/../../config/solr_environment.rb"
begin
n = Net::HTTP.new('localhost', SOLR_PORT)
n.request_head('/').value

rescue Net::HTTPServerException #responding
puts "Port #{SOLR_PORT} in use" and return

rescue Errno::ECONNREFUSED #not responding
Dir.chdir(SOLR_PATH) do
exec "java -Dsolr.data.dir=solr/data/#{ENV['RAILS_ENV']} -Djetty.port=#{SOLR_PORT} -jar start.jar"
sleep(5)
puts "#{ENV['RAILS_ENV']} Solr started sucessfuly on #{SOLR_PORT}, pid: #{pid}."
end
end
end


For reindexing models, get rake tasks from
henrik' blog

If you are using Capistrano, check this for
additional deployment options

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home