Example App for Elasticsearch Series on Codemy.net
- PostgreSQL 9.3+
- Elasticsearch 1.7+
- Redis 2.8+
Copy database.yml.example as database.yml then run
rake db:create db:schema:loadYou will need to download the example data dump from here Data Dump
Once you have the dump file run this command to import it into your local database
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U user -d yourdb moviedb_development.dumpOnce you have the data in your database you will need to index it into your elasticsearch
rails cOnce you are in the console use this, snippet of code. It will queue all the movies in the database for indexing.
Movie.find_each do |m|
m.index_document
endStart your sidekiq process so it runs the actual indexing
bundle exec sidekiq -q elasticsearch