简体   繁体   English

带有弹性搜索的django-haystack无法为新创建的对象建立索引

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

using 运用

Django==1.8
django-haystack==2.3.1

setting.py: 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. 每次创建或更新可以正常工作的对象并更新每个更改时,每次输入.manage.py rebuild_index命令。

Is there any solution to auto rebuild index when changes made to model objects. 有没有时更改了模型对象自动重建索引的任何解决方案。

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

HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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