From b566e7b1a591293123874629e6e15edbda6faf84 Mon Sep 17 00:00:00 2001 From: Simon Caminada Date: Thu, 15 Mar 2018 15:14:47 +0100 Subject: [PATCH] haystack search multilang --- settings.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/settings.py b/settings.py index ee211c0..fb30fda 100644 --- a/settings.py +++ b/settings.py @@ -54,9 +54,15 @@ HAYSTACK_DEFAULT_OPERATOR = 'OR' HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', - 'PATH': os.path.join(BASE_DIR, 'whoosh', 'index', 'de'), + 'PATH': os.path.join(BASE_DIR, 'whoosh', 'index', 'default'), }, } +for lang_code, lang in LANGUAGES: + HAYSTACK_CONNECTIONS[lang_code] = {} + HAYSTACK_CONNECTIONS[lang_code].update({ + 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', + 'PATH': os.path.join(BASE_DIR, 'whoosh', 'index', lang_code), + }) HAYSTACK_ROUTERS = ['aldryn_search.router.LanguageRouter', ]