From ea1fb90279de6e317943bb808798a796133a50ca Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 9 Sep 2018 11:55:19 +1200 Subject: [PATCH] Create the search index --- .travis.yml | 2 +- lib/tasks/search.rake | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 lib/tasks/search.rake diff --git a/.travis.yml b/.travis.yml index 323d3a097..1194ab1e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,8 @@ before_install: - export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH - ./script/install_codeclimate.sh - ./script/install_linters.sh - # Force Travis to use Elastic Search 2.4.0 - ./script/install_elasticsearch.sh + - RAILS_ENV=test bundle exec rake search:create script: - set -e - > diff --git a/lib/tasks/search.rake b/lib/tasks/search.rake new file mode 100644 index 000000000..00e377688 --- /dev/null +++ b/lib/tasks/search.rake @@ -0,0 +1,7 @@ + +namespace :search do + desc "Create elastic search index" + task create: :environment do + Crop.__elasticsearch__.create_index! force: true + end +end