diff --git a/README.md b/README.md index f7c8e1151..7887f8a92 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,10 @@ class Article < ActiveRecord::Base include Elasticsearch::Model::Callbacks end +# Index creation right at import time is not encouraged. +# Typically, you would call create_index! asynchronously (e.g. in a cron job) +# However, we are adding it here so that this usage example can run correctly. +Article.__elasticsearch__.create_index! Article.import @articles = Article.search('foobar').records