Class: Sunspot::Rails::Server
- Inherits:
-
Solr::Server
- Object
- Solr::Server
- Sunspot::Rails::Server
- Defined in:
- lib/sunspot/rails/server.rb
Constant Summary collapse
- LOG_LEVELS =
ActiveSupport log levels are integers; this array maps them to the appropriate java.util.logging.Level constant
%w(FINE INFO WARNING SEVERE SEVERE INFO)
Instance Method Summary collapse
-
#bind_address ⇒ Object
Address on which to run Solr.
-
#log_file ⇒ Object
Log file for Solr.
-
#log_level ⇒ Object
Severity level for logging.
-
#max_memory ⇒ Object
Maximum Java heap size for Solr.
-
#min_memory ⇒ Object
Minimum Java heap size for Solr.
-
#multicore ⇒ Object
A boolean value indicating whether or not solr is being run with multiple cores.
-
#pid_dir ⇒ Object
Directory in which to store PID files.
-
#pid_file ⇒ Object
Name of the PID file.
-
#port ⇒ Object
Port on which to run Solr.
-
#solr_data_dir ⇒ Object
Directory to store lucene index data files.
-
#solr_home ⇒ Object
Directory to use for Solr home.
-
#solr_jar ⇒ Object
Solr start jar.
Instance Method Details
#bind_address ⇒ Object
Address on which to run Solr
50 51 52 |
# File 'lib/sunspot/rails/server.rb', line 50 def bind_address configuration.bind_address end |
#log_file ⇒ Object
Log file for Solr. File is in the rails log/ directory.
72 73 74 |
# File 'lib/sunspot/rails/server.rb', line 72 def log_file File.join(::Rails.root, 'log', "sunspot-solr-#{::Rails.env}.log") end |
#log_level ⇒ Object
Severity level for logging. This is based on the severity level for the Rails logger.
65 66 67 |
# File 'lib/sunspot/rails/server.rb', line 65 def log_level LOG_LEVELS[::Rails.logger.level] end |
#max_memory ⇒ Object
Maximum Java heap size for Solr
86 87 88 |
# File 'lib/sunspot/rails/server.rb', line 86 def max_memory configuration.max_memory end |
#min_memory ⇒ Object
Minimum Java heap size for Solr
79 80 81 |
# File 'lib/sunspot/rails/server.rb', line 79 def min_memory configuration.min_memory end |
#multicore ⇒ Object
A boolean value indicating whether or not solr is being run with multiple cores
93 94 95 |
# File 'lib/sunspot/rails/server.rb', line 93 def multicore !!configuration.multicore end |
#pid_dir ⇒ Object
Directory in which to store PID files
11 12 13 |
# File 'lib/sunspot/rails/server.rb', line 11 def pid_dir configuration.pid_dir || File.join(::Rails.root, 'tmp', 'pids') end |
#pid_file ⇒ Object
Name of the PID file
18 19 20 |
# File 'lib/sunspot/rails/server.rb', line 18 def pid_file "sunspot-solr-#{::Rails.env}.pid" end |
#port ⇒ Object
Port on which to run Solr
57 58 59 |
# File 'lib/sunspot/rails/server.rb', line 57 def port configuration.port end |
#solr_data_dir ⇒ Object
Directory to store lucene index data files
Returns
- String
-
data_path
29 30 31 |
# File 'lib/sunspot/rails/server.rb', line 29 def solr_data_dir configuration.data_path end |
#solr_home ⇒ Object
Directory to use for Solr home.
36 37 38 |
# File 'lib/sunspot/rails/server.rb', line 36 def solr_home File.join(configuration.solr_home) end |
#solr_jar ⇒ Object
Solr start jar
43 44 45 |
# File 'lib/sunspot/rails/server.rb', line 43 def solr_jar configuration.solr_jar || super end |