Skip to content

code-ops-show/moviedb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f781303 · Aug 2, 2016

History

95 Commits
May 5, 2016
May 23, 2016
Jul 22, 2016
May 1, 2015
Nov 23, 2015
Apr 19, 2015
Apr 19, 2015
Oct 12, 2015
Apr 19, 2015
Jul 22, 2016
Aug 2, 2016
Jul 22, 2016
Jul 14, 2016
Jul 22, 2016
Jul 14, 2016
Apr 19, 2015
May 5, 2016
Apr 19, 2015
Apr 19, 2015

Repository files navigation

moviedb

Example App for Elasticsearch Series on Codemy.net

Dependencies

  • PostgreSQL 9.3+
  • Elasticsearch 1.7+
  • Redis 2.8+

Setup

Copy database.yml.example as database.yml then run

rake db:create db:schema:load

You 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.dump

Once you have the data in your database you will need to index it into your elasticsearch

rails c

Once 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
end

Start your sidekiq process so it runs the actual indexing

bundle exec sidekiq -q elasticsearch