A repository that wraps the provided Bungiesearch signal processing class in your own celery tasks.
This Django app allows you to utilize Celery for automatically updating and deleting objects in a Bungiesearch search index.
Compatible with most recent version of Bungiesearch, which is similar to Haystack, but interacts directly with elasticsearch-dsl and therefore allows for more custom ranking functions.
pip install celery-bungiesearch
- Django 1.4.3+
- Bungiesearch 1.1.0+
- Celery 3.1.18+
- Add
'celery_bungiesearch'
toINSTALLED_APPS
in settings
INSTALLED_APPS = [
# ..
'celery_bungiesearch',
]
- Add
CelerySignalProcessor
tosettings.BUNGIESEARCH['SIGNAL_CLASS']
in settings. This will ensure that any model that's managed by aBungiesearchManager
acquireCelerySignalProcessor
as the signal processor.
from celery_bungiesearch import CelerySignalProcessor
BUNGIESEARCH = {
# ..
'SIGNALS': {
'SIGNAL_CLASS': 'celery_bungiesearch.signals.CelerySignalProcessor',
'BUFFER_SIZE' : 100
}
}
- Add celery-bungisearch configuration variables to your settings file. The task below is the default version, but you may include your own custom class if you desire:
CELERY_BUNGIESEARCH_QUEUE = None
CELERY_BUNGIESEARCH_TASK = 'celery_bungiesearch.tasks.celeryindex.CeleryIndexTask'
- Ensure your Celery instance is running.
You can run tests locally for celery-bungiesearch by simply running the command tox
or tox test
. You must have an instance of elasticsearch running locally. You can also run tests using continuous integration with Travis CI (build status at the top of this README).
This application borrows liberally from Jannis Leidel's celery-haystack and from Christopher Rabotin's Bungiesearch, which itself was the inspiration for this project.
Please submit a pull request or use the Github issue tracker for any bug fixes, bug reports, or feature requests.