擅长:python、mysql、java
<p>您可以通过将此添加到设置.py地址:</p>
<pre><code>HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
</code></pre>
<p>它将类似于销毁<code>update</code>命令,如果映射索引中有任何更新,它将自动触发。你知道吗</p>
<p>更多详情请参见:</p>
<p><a href="http://django-haystack.readthedocs.io/en/v2.4.1/signal_processors.html#realtime-realtimesignalprocessor" rel="nofollow noreferrer">http://django-haystack.readthedocs.io/en/v2.4.1/signal_processors.html#realtime-realtimesignalprocessor</a></p>
<p>如果重新索引可能需要一些时间,您应该使用队列来防止请求/响应周期受阻,这里建议使用芹菜等可能的解决方案:</p>
<p><a href="http://django-haystack.readthedocs.io/en/v2.4.1/other_apps.html#ref-other-apps" rel="nofollow noreferrer">http://django-haystack.readthedocs.io/en/v2.4.1/other_apps.html#ref-other-apps</a></p>