Sha256: 09a7342104634db6c973531e24cee171fd840710086e5252fb25bbcb7a8894eb

Contents?: true

Size: 1.09 KB

Versions: 17

Compression:

Stored size: 1.09 KB

Contents

namespace :sunspot do
  namespace :solr do
    desc 'Start the Solr instance'
    task start: :environment do
      case RUBY_PLATFORM
      when /w(in)?32$/, /java$/
        abort("This command is not supported on #{RUBY_PLATFORM}. " +
              "Use rake sunspot:solr:run to run Solr in the foreground.")
      end
      server.start
      puts 'Successfully started Solr ...'
    end

    desc 'Run the Solr instance in the foreground'
    task run: :environment do
      server.run
    end

    desc 'Stop the Solr instance'
    task stop: :environment do
      server.stop
      puts 'Successfully stopped Solr ...'
    end

    desc 'Restart the Solr instance'
    task restart: :environment do
      Rake::Task['sunspot:solr:stop'].invoke if File.exist?(server.pid_path)
      Rake::Task['sunspot:solr:start'].invoke
    end

    # for backwards compatibility
    task :reindex, [:batch_size, :models, :silence] => :"sunspot:reindex"

    def server
      

      if defined?(Sunspot::Rails::Server)
        Sunspot::Rails::Server.new
      else
        Sunspot::Solr::Server.new
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
sunspot_solr-2.7.1 lib/sunspot/solr/tasks.rb
sunspot_solr-2.7.0 lib/sunspot/solr/tasks.rb
sunspot_solr-2.6.0 lib/sunspot/solr/tasks.rb
sunspot_solr-2.5.0 lib/sunspot/solr/tasks.rb
sunspot_solr-2.4.0 lib/sunspot/solr/tasks.rb
sunspot_solr-2.3.0 lib/sunspot/solr/tasks.rb
sunspot_solr-2.2.8 lib/sunspot/solr/tasks.rb
sunspot_solr-2.2.7 lib/sunspot/solr/tasks.rb
sunspot_solr-2.2.6 lib/sunspot/solr/tasks.rb
sunspot_solr-2.2.5 lib/sunspot/solr/tasks.rb
sunspot_solr-2.2.4 lib/sunspot/solr/tasks.rb
sunspot_solr-2.2.3 lib/sunspot/solr/tasks.rb
sunspot_solr-2.2.2 lib/sunspot/solr/tasks.rb
sunspot_solr-2.2.1 lib/sunspot/solr/tasks.rb
sunspot_solr-jts-2.2.0 lib/sunspot/solr/tasks.rb
sunspot_solr-jts-2.2.0.rc1 lib/sunspot/solr/tasks.rb
sunspot_solr-2.2.0 lib/sunspot/solr/tasks.rb