Skip to content

theonion/django-elastimorphic

Repository files navigation

django-elastimorphic

A marriage of django-polymorphic and elasticutils. This should be considered a work-in-progress and might change at any time.

Build Status Coverage Status

Usage

  • python setup.py install
  • Include "elastimorphic" in your INSTALLED_APPS
  • Create models which subclass PolymorphicIndexable and PolymorphicModel
  • Implement the PolymorphicIndexable interfaces on your models
  • manage.py synces <alias_name> creates indexes for your models in elasticsearch with alias <app_name><model_name>_<alias_name>
  • manage.py es_swap_aliases <alias_name> activates the indexes in ES
  • manage.py bulk_index populates the index with data in the PolymorphicIndexable models

Running tests

Elastimorphic includes a simple Vagrantfile and shell provisioning script which installs elasticsearch in a VM so you don't have to.

  • Install Vagrant
  • Run vagrant up in the root directory of your django-elastimorphic checkout
  • Get a cup of coffee and wait for that to complete
  • python setup.py test

License

MIT