Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/solr_wrapper/tasks/solr_wrapper.rake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ namespace :solr do
end
end

namespace :collection do
desc 'Create a collection in solr'
task create: :start do
start = ARGV.find_index('solr:collection:create')
if ARGV.length >= start + 2
dir = ARGV[start + 1]
name = ARGV[start + 2]
# Rake tries to run these as tasks.
task(dir.to_sym) {}
task(name.to_sym) {}
@solr_instance.create(dir: dir, name: name)
else
$stderr.puts "Usage: rake solr:collection:create <directory> <name>"
end
end
end

desc 'restart solr'
task restart: :environment do
puts "Restarting solr"
Expand Down