From be33e893232e2c2212570b9be6034f38378b1cce Mon Sep 17 00:00:00 2001
From: Jorran de Wit <jorrandewit@outlook.com>
Date: Sat, 19 Aug 2017 13:46:58 +0200
Subject: [PATCH] Update indexprocessors

---
 SciPost_v1/settings/base.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/SciPost_v1/settings/base.py b/SciPost_v1/settings/base.py
index 70d622cb4..8ca8486fa 100644
--- a/SciPost_v1/settings/base.py
+++ b/SciPost_v1/settings/base.py
@@ -104,11 +104,18 @@ HAYSTACK_CONNECTIONS = {
         'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
         'PATH': 'local_files/haystack/',
     },
-    'base_search': {
-        'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
-    }
+    # SimpleEngine doesn't need indexing, and could be useful for debugging, however
+    # does not fully support all haystack features
+    # 'base_search': {
+    #     'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
+    # }
 }
 
+# Brute force automatically re-index Haystack using post_save signals on all models.
+# When write-traffic increases, a custom processor is preferred which only connects
+# signals to eg. `vet-accepted` signals possibly using cron jobs instead of realtime updates.
+HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
+
 
 SPHINXDOC_BASE_TEMPLATE = 'scipost/base.html'
 SPHINXDOC_PROTECTED_PROJECTS = {
-- 
GitLab