Class: Sunspot::Rails::Server

Inherits:
Solr::Server
  • Object
show all
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

Instance Method Details

#bind_addressObject

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_fileObject

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_levelObject

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_memoryObject

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_memoryObject

Minimum Java heap size for Solr



79
80
81
# File 'lib/sunspot/rails/server.rb', line 79

def min_memory
  configuration.min_memory
end

#multicoreObject

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_dirObject

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_fileObject

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

#portObject

Port on which to run Solr



57
58
59
# File 'lib/sunspot/rails/server.rb', line 57

def port
  configuration.port
end

#solr_data_dirObject

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_homeObject

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_jarObject

Solr start jar



43
44
45
# File 'lib/sunspot/rails/server.rb', line 43

def solr_jar
  configuration.solr_jar || super
end