Skip to content

Commit f9e86de

Browse files
anandvcestolfo
authored andcommitted
Updated README.MD (#771)
* Updated README.MD Include the step to create the index for the model that we'll import. * Commented to encourage asynchronous index creation I've added a comment so that users are encouraged to do `create_index!` asynchronously and not at the same time as `import`.
1 parent a67ecc1 commit f9e86de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ class Article < ActiveRecord::Base
7171
include Elasticsearch::Model::Callbacks
7272
end
7373

74+
# Index creation right at import time is not encouraged.
75+
# Typically, you would call create_index! asynchronously (e.g. in a cron job)
76+
# However, we are adding it here so that this usage example can run correctly.
77+
Article.__elasticsearch__.create_index!
7478
Article.import
7579

7680
@articles = Article.search('foobar').records

0 commit comments

Comments
 (0)