Integration of django-haystack and search backends for Pootle.
Currently only installable from git
$ pip install -e git@github.com:translate/pootle_index
Add haystack
and pootle_index
to your INSTALLED_APPS
:
INSTALLED_APPS += ["haystack", "pootle_index"]
Add a configuration for your haystack backend, only Elasticsearch is currently tested
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'haystack'}}
Add a configuration for a haystack signal processor, to keep your index up to date:
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
Finally set the POOTLE_SEARCH_BACKEND
in your settings to the haystack search backend.
POOTLE_SEARCH_BACKEND = "pootle_index.search.HaystackSearchBackend"
If you wish to clear the index and start again you can do the following:
$ pootle rebuild_index
Rebuilding the index will take a very long time on a large site.
To simply update the index:
$ pootle update_index