简体   繁体   中英

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

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.

您需要在设置中激活实时信号处理器:

HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM