django-haystack with elastic search not building index for newly created objects

271 views Asked by At

using

Django==1.8
django-haystack==2.3.1

setting.py:

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE':'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
        'URL': 'http://127.0.0.1:9200/',
        'INDEX_NAME': 'haystack',
        'TIMEOUT': 60,
    },
}

Newly created(updated or deleted )objects are not updating in my elastic search index. entering .manage.py rebuild_index command each time when creating or updating objects which working perfectly and updating each change.

Is there any solution to auto rebuild index when changes made to model objects.

1

There are 1 answers

0
chaos On BEST ANSWER

You need to have the real time signal processor activated in settings:

HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'