diff options
author | francis <francis> | 2008-03-06 13:50:24 +0000 |
---|---|---|
committer | francis <francis> | 2008-03-06 13:50:24 +0000 |
commit | f7164bb8fdc075d133f98b5c7fc789493648dc8e (patch) | |
tree | 9782cde82091cbeb95d6f122ae12884427054d9a | |
parent | 41e8abfbfba783122ef2ff10cb794ac2d5895fe1 (diff) |
SOLR port
-rw-r--r-- | config/solr.yml-example | 8 | ||||
-rw-r--r-- | todo.txt | 1 | ||||
-rw-r--r-- | vendor/plugins/acts_as_solr/config/environment.rb | 7 |
3 files changed, 12 insertions, 4 deletions
diff --git a/config/solr.yml-example b/config/solr.yml-example index a6f861839..c3505d3f3 100644 --- a/config/solr.yml-example +++ b/config/solr.yml-example @@ -1,10 +1,10 @@ # Config file for the acts_as_solr plugin. # -# If you change the host or port number here, make sure you update -# them in your Solr config file +# XXX This is hackily read by vendor/plugins/acts_as_solr/config/environment.rb +# for the rake task to start things with the right port. development: - url: http://localhost:8982/solr + url: http://localhost:8999/solr production: - url: http://localhost:8983/solr
\ No newline at end of file + url: http://localhost:8983/solr @@ -1,6 +1,7 @@ Search: Deploy solr - do something with config file and access to ports +Security Go to correct id for incoming / outgoing messages Show correct extract for incoming / outgoing messages diff --git a/vendor/plugins/acts_as_solr/config/environment.rb b/vendor/plugins/acts_as_solr/config/environment.rb index a68061439..3450bfe83 100644 --- a/vendor/plugins/acts_as_solr/config/environment.rb +++ b/vendor/plugins/acts_as_solr/config/environment.rb @@ -1,6 +1,13 @@ ENV['RAILS_ENV'] = (ENV['RAILS_ENV'] || 'development').dup SOLR_PATH = "#{File.dirname(File.expand_path(__FILE__))}/../solr" unless defined? SOLR_PATH +# XXX hacky stuff to read the port from the main config file +RAILS_SOLR_CONFIG="#{SOLR_PATH}/../../../../config/solr.yml" +rails_solr_config = YAML.load(File.read(RAILS_SOLR_CONFIG)) +rails_solr_url = rails_solr_config[ENV['RAILS_ENV']]['url'] +rails_solr_port = rails_solr_url.match(/http:\/\/localhost:(\d+)\/solr/)[1] +SOLR_PORT = rails_solr_port.to_i + unless defined? SOLR_PORT SOLR_PORT = ENV['PORT'] || case ENV['RAILS_ENV'] when 'test' then 8981 |