Class Sunspot::Rails::Server

  1. lib/sunspot/rails/server.rb
Parent: Sunspot::Server

Constants

LOG_LEVELS = %w(FINE INFO WARNING SEVERE SEVERE INFO)   ActiveSupport log levels are integers; this array maps them to the appropriate java.util.logging.Level constant

Public instance methods

bootstrap ()

Bootstrap a new solr_home by creating all required directories.

Returns

Boolean:success
[show source]
# File lib/sunspot/rails/server.rb, line 26
      def bootstrap
        unless @bootstrapped
          install_solr_home
          @bootstrapped = true
        end
      end
lib_path ()

Directory to store custom libraries for solr

[show source]
# File lib/sunspot/rails/server.rb, line 36
      def lib_path
        File.join( solr_home, 'lib' )
      end
log_file ()

Log file for Solr. File is in the rails log/ directory.

[show source]
# File lib/sunspot/rails/server.rb, line 90
      def log_file
        File.join(::Rails.root, 'log', "sunspot-solr-#{::Rails.env}.log")
      end
log_level ()

Severity level for logging. This is based on the severity level for the Rails logger.

[show source]
# File lib/sunspot/rails/server.rb, line 83
      def log_level
        LOG_LEVELS[::Rails.logger.level]
      end
max_memory ()

Maximum Java heap size for Solr

[show source]
# File lib/sunspot/rails/server.rb, line 104
      def max_memory
        configuration.max_memory
      end
min_memory ()

Minimum Java heap size for Solr

[show source]
# File lib/sunspot/rails/server.rb, line 97
      def min_memory
        configuration.min_memory
      end
pid_dir ()

Directory in which to store PID files

[show source]
# File lib/sunspot/rails/server.rb, line 43
      def pid_dir
        File.join(::Rails.root, 'tmp', 'pids')
      end
pid_file ()

Name of the PID file

[show source]
# File lib/sunspot/rails/server.rb, line 50
      def pid_file
        "sunspot-solr-#{::Rails.env}.pid"
      end
port ()

Port on which to run Solr

[show source]
# File lib/sunspot/rails/server.rb, line 75
      def port
        configuration.port
      end
run ()
[show source]
# File lib/sunspot/rails/server.rb, line 13
      def run
        bootstrap
        super
      end
solr_data_dir ()

Directory to store lucene index data files

Returns

String:data_path
[show source]
# File lib/sunspot/rails/server.rb, line 61
      def solr_data_dir
        File.join(solr_home, 'data', ::Rails.env)
      end
solr_home ()

Directory to use for Solr home.

[show source]
# File lib/sunspot/rails/server.rb, line 68
      def solr_home
        File.join(::Rails.root, 'solr')
      end
start ()
[show source]
# File lib/sunspot/rails/server.rb, line 8
      def start
        bootstrap
        super
      end