forked from TagesschuleElementa/www.tagesschule-elementa.ch
added elasticsearch
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
DEBUG=True
|
||||
STAGE=local
|
||||
DEFAULT_HAYSTACK_URL=es+http://es:9200/index-*
|
||||
DATABASE_URL=postgres://postgres@postgres:5432/db
|
||||
|
||||
@@ -5,6 +5,7 @@ services:
|
||||
build: "."
|
||||
links:
|
||||
- "db:postgres"
|
||||
- "es:es"
|
||||
ports:
|
||||
- "8009:80"
|
||||
volumes:
|
||||
@@ -19,3 +20,6 @@ services:
|
||||
POSTGRES_DB: "db"
|
||||
volumes:
|
||||
- ".:/app:rw"
|
||||
|
||||
es:
|
||||
image: elasticsearch:5.6-alpine
|
||||
|
||||
@@ -11,7 +11,6 @@ https://control.divio.com/api/v1/apps/serve/djangocms-picture/2.0.6/005e8663-d1c
|
||||
https://control.divio.com/api/v1/apps/serve/djangocms-text-ckeditor/3.5.3/a7b5179f-cea5-4af8-b235-6b7f709c4e6a/djangocms-text-ckeditor-3.5.3.tar.gz#egg=djangocms-text-ckeditor==3.5.3
|
||||
https://control.divio.com/api/v1/apps/serve/django-filer/1.3.0.1/bcb7d25b-6922-48a9-a252-9bc165f6403e/django-filer-1.3.0.1.tar.gz#egg=django-filer==1.3.0.1
|
||||
# </INSTALLED_ADDONS>
|
||||
Whoosh==2.7.4
|
||||
django-haystack==2.7.0
|
||||
aldryn-search==0.5.0
|
||||
django-fontawesome==0.3.1
|
||||
|
||||
24
settings.py
24
settings.py
@@ -57,21 +57,17 @@ ALDRYN_SEARCH_INDEX_BASE_CLASS = 'project.search.SearchIndex'
|
||||
|
||||
HAYSTACK_CUSTOM_HIGHLIGHTER = 'project.search.Highlighter'
|
||||
HAYSTACK_DEFAULT_OPERATOR = 'OR'
|
||||
HAYSTACK_INDEX_PATH = os.path.join('/whoosh', 'index')
|
||||
HAYSTACK_CONNECTIONS = {
|
||||
'default': {
|
||||
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
|
||||
'PATH': os.path.join(HAYSTACK_INDEX_PATH, '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(HAYSTACK_INDEX_PATH, lang_code),
|
||||
})
|
||||
|
||||
HAYSTACK_ROUTERS = ['aldryn_search.router.LanguageRouter', ]
|
||||
if DEFAULT_HAYSTACK_URL:
|
||||
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