haystack search multilang

This commit is contained in:
2018-03-15 15:14:47 +01:00
parent 534e83143f
commit b566e7b1a5

View File

@@ -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', ]