From a11d84da2a37c5448b98b0067dc6d7f7c6b85db4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 25 Jul 2022 16:41:33 +0200 Subject: [PATCH] revamp full text search to use postgresql --- debian/control | 1 - panikdb/settings.py | 9 +-- panikdb/static/css/style.scss | 18 +++++ panikdb/templates/base.html | 2 +- panikdb/templates/search/search.html | 108 +++++++++++---------------- panikdb/urls.py | 12 +-- panikdb/views.py | 32 ++++++++ requirements.txt | 1 - 8 files changed, 95 insertions(+), 88 deletions(-) diff --git a/debian/control b/debian/control index db6582c..6b750c0 100644 --- a/debian/control +++ b/debian/control @@ -13,7 +13,6 @@ Standards-Version: 3.9.1 Package: python3-panikdb Architecture: all Depends: python3-django-ckeditor, - python3-django-haystack, python3-django-panik-agendas, python3-django-panik-combo, python3-django-panik-emissions, diff --git a/panikdb/settings.py b/panikdb/settings.py index 0ef539d..f8111e7 100644 --- a/panikdb/settings.py +++ b/panikdb/settings.py @@ -144,7 +144,6 @@ INSTALLED_APPS = ( 'django.contrib.admin', 'registration', 'ckeditor', - 'haystack', 'taggit', 'emissions', 'newsletter', @@ -227,13 +226,6 @@ CKEDITOR_CONFIGS = { CKEDITOR_CONFIGS['small'] = copy.copy(CKEDITOR_CONFIGS['default']) CKEDITOR_CONFIGS['small']['height'] = 150 -HAYSTACK_CONNECTIONS = { - 'default': { - 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', - 'URL': 'http://127.0.0.1:8985/solr/panik', - }, -} - CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', @@ -312,6 +304,7 @@ COMBO_CELL_ASSET_SLOTS = {} COMBO_CELL_TEMPLATES = {} WIKI_SEARCH_BASE_URL = None CELL_CONDITIONS_ENABLED = False +FTS_DICTIONARY_CONFIG = 'french' local_settings_file = os.environ.get( 'PANIKDB_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py') diff --git a/panikdb/static/css/style.scss b/panikdb/static/css/style.scss index e8e8804..b3ca1e1 100644 --- a/panikdb/static/css/style.scss +++ b/panikdb/static/css/style.scss @@ -989,3 +989,21 @@ div.section > div > *:first-child { a.button { display: inline; } + +.search--form { + display: flex; + column-gap: 1em; + input { + flex: 1; + margin: 0; + } +} + +.search--hits { + display: flex; + column-gap: 1em; + .section { + flex: 1; + margin: 0; + } +} diff --git a/panikdb/templates/base.html b/panikdb/templates/base.html index c28e24e..1771621 100644 --- a/panikdb/templates/base.html +++ b/panikdb/templates/base.html @@ -30,7 +30,7 @@ {% block subheader %}