docbrown/lib/tasks/search.rake
rhymes e27c9b77a3
Refactor Elasticsearch client access (#6307) [deploy]
* Add Transport module to Search
* Test public methods only
* Add Search::Client with exception handling
* Remove Transport and request do
* Replace SearchClient with Search::Client
2020-02-28 11:38:37 -05:00

21 lines
477 B
Ruby

namespace :search do
desc "set up Elasticsearch indexes"
task setup: :environment do
Search::Cluster.setup_indexes
end
desc "update Elasticsearch index mappings"
task update_mappings: :environment do
Search::Cluster.update_mappings
end
desc "tear down Elasticsearch indexes"
task destroy: :environment do
if Rails.env.production?
puts "Will NOT destroy indexes in production"
exit
end
Search::Cluster.delete_indexes
end
end