Class: SimpleSolr::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_solr/configuration.rb

Overview

SimpleSolr is configured via the config/simple_solr.yml file, which contains properties keyed by environment name.

production:
  solr:
    hostname: "solr.slave.local"
    port: 8983
    path: "/solr"
  master_solr:
    hostname: "solr.master.local"
    port: 8983
    path: "/solr"

If the master_solr configuration is present, SimpleSolr will use the Solr instance specified there for all write operations, and the Solr configured under solr for all read operations.

Instance Method Summary collapse

Instance Method Details

#master_uriObject

Full URI to use for all write operations. Automatically falls back to the uri when no master defined.



47
48
49
# File 'lib/simple_solr/configuration.rb', line 47

def master_uri
  "http://#{master_hostname}:#{master_port}#{master_path}"
end

#present?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/simple_solr/configuration.rb', line 36

def present?
  not user_configuration.nil?
end

#uriObject

Full URI to use for all read operations.



41
42
43
# File 'lib/simple_solr/configuration.rb', line 41

def uri
  "http://#{hostname}:#{port}#{path}"
end