Index: lib/acts_as_solr.rb =================================================================== --- lib/acts_as_solr.rb (revision 496) +++ lib/acts_as_solr.rb (revision 497) @@ -43,12 +43,14 @@ if RAILS_ENV == 'development' server = config['development']['host'] port = config['development']['port'] + servlet_path = config['development']['servlet_path'] elsif RAILS_ENV == 'production' server = config['production']['host'] port = config['production']['port'] + servlet_path = config['production']['servlet_path'] end url = URI.parse("http://#{server}:#{port}") - post = Net::HTTP::Post.new(@mode == :search ? "/solr/select" : "/solr/update") + post = Net::HTTP::Post.new(@mode == :search ? "/#{servlet_path}/select" : "/#{servlet_path}/update") post.body = @body post.content_type = 'application/x-www-form-urlencoded; charset=utf-8' response = Net::HTTP.start(url.host, url.port) do |http| @@ -56,7 +58,7 @@ end return response.body rescue - raise "Couldn't connect to the Solr server on #{server}:#{port}. #{$!}" + raise "Couldn't connect to the Solr server on #{server}:#{port} located at /#{servlet_path}. #{$!}" false end end @@ -65,4 +67,4 @@ end # reopen ActiveRecord and include the acts_as_solr method -ActiveRecord::Base.extend ActsAsSolr::ActsMethods \ No newline at end of file +ActiveRecord::Base.extend ActsAsSolr::ActsMethods Index: lib/templates/solr.yml =================================================================== --- lib/templates/solr.yml (revision 496) +++ lib/templates/solr.yml (revision 497) @@ -6,7 +6,9 @@ development: host: localhost port: 8983 + servlet_path: solr production: host: localhost - port: 8983 \ No newline at end of file + port: 8983 + servlet_path: solr \ No newline at end of file