akuchling / celery-simple-elasticsearch

Provides the ability to re-index Django models via celery workers on update.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

celery-simple-elasticsearch

This Django app allows you to utilize Celery for automatically updating and deleting objects in a Django Simple Elasticsearch search index.

Requirements

Installation

Use your favorite Python package manager to install the app from PyPI, e.g.:

pip install celery-simple-elasticsearch

By default a few dependencies will automatically be installed:

Usage

  1. Add 'celery_simple_elasticsearch' to the INSTALLED_APPS setting

    INSTALLED_APPS = [
        # ..
        'celery_simple_elasticsearch',
    ]
  2. Alter all of your ElasticsearchIndexMixin subclasses to also inherit from celery_simple_elasticsearch.indexes.CelerySearchIndex

    from django.db import models
    from celery_simple_elasticsearch.indexes import CelerySearchIndex
    from simple_elasticsearch.mixins import ElasticsearchIndexMixin
    
    class Person(CelerySearchIndex, ElasticsearchIndexMixin, models.Model):
      first_name = models.CharField(max_length=30)
      last_name = models.CharField(max_length=30)
  3. Ensure your Celery instance is running.

Thanks

This app is a blatant rip-off of Celery Haystack. A great basis, but I didn't want Haystack users to have all the celery goodness to themselves.

Issues

Please use the Github issue tracker for any bug reports or feature requests.

About

Provides the ability to re-index Django models via celery workers on update.

License:Other


Languages

Language:Python 100.0%