Skip to content

Working with Haystack and ElasticSearch

Rizky Maulana Nugraha edited this page Apr 23, 2015 · 1 revision

ElasticSearch

We set up ElasticSearch as a docker container in the docker-compose.yml configuration. Elastic search will be active at ElasticSearch local. The docker container came from official ElasticSearch repo. So we don't have to setup anything at this point

Haystack

The following dependencies must be met:

  • django-haystack (the core haystack package)
  • elasticsearch (the ElasticSearch-python binding/wrapper for manage.py)

Integration instruction can be found in Haystack's Getting Started.

After you set up the site by running:

make run

You can do haystack management via command line:

make rebuildindex

to rebuild index from scratch discarding current index and

make updateindex

to update your index. Make sure you already updated your models and do migrations. We will need to setup for update index command to occur at regular interval using cron job.

Notes

  1. Raven is in conflict with haystack. Description can be found at this issue here. We fix this by applying patches in the raven installed at uwsgi target. Check the production dockerfile for more info.
  2. New index class requires server restart.

Clone this wiki locally