Sha256: 1f42f6114ec1cc774e3e461a8a107b56cdd9563c52d2ebb6f07e9bfa1789638e

Contents?: true

Size: 1.88 KB

Versions: 31

Compression:

Stored size: 1.88 KB

Contents

#!/usr/bin/env ruby
begin
  require 'fileutils'
  require 'tempfile'
  require 'tmpdir'
  require 'optparse'
  require File.join(File.dirname(__FILE__), '..', 'lib', 'sunspot', 'solr', 'server')
rescue LoadError => e
  if require 'rubygems'
    retry
  else
    raise(e)
  end
end

server = Sunspot::Solr::Server.new

opts = OptionParser.new do |opts|
  opts.banner = "Usage: sunspot-solr (start|stop|run) [options]"

  opts.on '-p', '--port=PORT', 'Port on which to run Solr (default 8983)' do |p|
    server.port = p
  end

  opts.on '-b', '--bind-address=address', 'Interface on which to run Solr (default 0.0.0.0)' do |b|
    server.bind_address = b
  end

  opts.on '-d', '--data-directory=DIRECTORY', 'Solr data directory' do |d|
    server.solr_data_dir = File.expand_path(d)
  end

  opts.on '-s', '--solr-home=HOME', 'Solr home directory (should contain conf/ directory)' do |s|
    server.solr_home = File.expand_path(s)
  end

  opts.on '-j', '--solr-jar=JAR', 'Solr start jar' do |j|
    server.solr_jar = File.expand_path(j)
  end

  opts.on '--pid-dir=PID_DIR', 'Directory for pid files' do |pd|
    server.pid_dir = File.expand_path(pd)
  end

  opts.on '-l', '--log-level=LOG_LEVEL', 'Solr logging level' do |l|
    server.log_level = l
  end

  opts.on '--log-file=LOG_FILE', 'Path to Solr log file' do |lf|
    server.log_file = File.expand_path(lf)
  end

  opts.on '--max-memory=MEMORY', 'Specify the maximum size of the memory allocation pool' do |mm|
    server.max_memory = mm
  end

  opts.on '--min-memory=MEMORY', 'Specify the initial size of the memory allocation pool' do |mm|
    server.min_memory = mm
  end
end

opts.parse!

begin
  case ARGV[0]
  when 'start'
    server.start
  when 'run'
    server.run
  when 'stop'
    server.stop
  when 'restart'
    server.stop
    server.start
  else
    abort(opts.help)
  end
rescue Sunspot::Solr::Server::ServerError => e
  abort(e.message)
end

Version data entries

31 entries across 31 versions & 10 rubygems

Version Path
qiny_sunspot_solr-2.1.0 bin/sunspot-solr
sunspot_solr-jts-2.2.0 bin/sunspot-solr
sunspot_solr-jts-2.2.0.rc1 bin/sunspot-solr
sunspot_solr-2.2.0 bin/sunspot-solr
sunspot_solr-2.1.1 bin/sunspot-solr
sunspot_solr-2.1.0 bin/sunspot-solr
sunspot_solr-2.0.0 bin/sunspot-solr
sunspot_solr-2.0.0.pre.130115 bin/sunspot-solr
gojee-sunspot-solr-2.0.5 bin/sunspot-solr
sunspot_solr-2.0.0.pre.120925 bin/sunspot-solr
sunspot_solr-2.0.0.pre.120924 sunspot_solr/bin/sunspot-solr
sunspot_rails-2.0.0.pre.120924 sunspot_solr/bin/sunspot-solr
sunspot-2.0.0.pre.120924 sunspot_solr/bin/sunspot-solr
gojee-sunspot-solr-2.0.4 bin/sunspot-solr
gojee-sunspot-solr-2.0.2 bin/sunspot-solr
sunspot_solr-2.0.0.pre.120720 bin/sunspot-solr
culturecode-sunspot_solr-2.0.0.pre bin/sunspot-solr
sunspot_solr-1.3.3 bin/sunspot-solr
sunspot_solr-1.3.2 bin/sunspot-solr
sunspot_solr-2.0.0.pre.120417 bin/sunspot-solr