haystack fix
This commit is contained in:
26
settings.py
26
settings.py
@@ -29,7 +29,6 @@ INSTALLED_APPS.extend([
|
||||
'portal',
|
||||
'project',
|
||||
'fontawesome',
|
||||
'haystack',
|
||||
'aldryn_search',
|
||||
'image_cropping',
|
||||
])
|
||||
@@ -61,22 +60,17 @@ ALDRYN_SEARCH_EXCLUDED_PLUGINS = [
|
||||
|
||||
HAYSTACK_CUSTOM_HIGHLIGHTER = 'project.search.Highlighter'
|
||||
HAYSTACK_DEFAULT_OPERATOR = 'OR'
|
||||
HAYSTACK_CONNECTIONS = {
|
||||
'default': {
|
||||
'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchBackend',
|
||||
'URL': 'https://wa6vrcqzp9:wdx2qnhlh2@search-sandbox-9002842602.eu-west-1.bonsaisearch.net',
|
||||
'INDEX_NAME': 'default',
|
||||
},
|
||||
}
|
||||
for lang_code, lang in LANGUAGES:
|
||||
HAYSTACK_CONNECTIONS[lang_code] = {}
|
||||
HAYSTACK_CONNECTIONS[lang_code].update({
|
||||
'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchBackend',
|
||||
'URL': 'https://wa6vrcqzp9:wdx2qnhlh2@search-sandbox-9002842602.eu-west-1.bonsaisearch.net',
|
||||
'INDEX_NAME': lang_code,
|
||||
})
|
||||
|
||||
HAYSTACK_ROUTERS = ['aldryn_search.router.LanguageRouter', ]
|
||||
if DEFAULT_HAYSTACK_URL and os.getenv('DJANGO_MODE') != 'build':
|
||||
from aldryn_haystack import haystack_url
|
||||
|
||||
HAYSTACK_CONNECTIONS = haystack_url.parse_i18n(
|
||||
url=DEFAULT_HAYSTACK_URL,
|
||||
language_codes=[lang[0] for lang in LANGUAGES],
|
||||
default_language_code=LANGUAGE_CODE,
|
||||
)
|
||||
|
||||
HAYSTACK_ROUTERS = ['aldryn_search.router.LanguageRouter']
|
||||
|
||||
CMS_TEMPLATE_INHERITANCE = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user