code-ops-show / moviedb

Example App for Elasticsearch Series

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Example App for Elasticsearch Series

License:MIT License


Languages

Language:Ruby 78.1%Language:HTML 20.2%Language:CSS 1.3%Language:Shell 0.2%Language:CoffeeScript 0.2%