From f1d2acdc253b71cf0b95f7e568aecdecf3762ec1 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sat, 13 Jan 2024 18:28:45 +0100 Subject: [PATCH] Remove whoosh in profit for Elasticsearch Signed-off-by: Emmy D'Anello --- requirements.txt | 4 ++-- tfjm/settings.py | 5 +++-- tox.ini | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index a66b533..637d52d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,7 @@ Django>=5.0,<6.0 django-crispy-forms~=2.1 django-extensions~=3.2.3 django-filter~=23.5 +elasticsearch~=7.17.9 git+https://github.com/django-haystack/django-haystack.git#v3.3b1 django-mailer~=2.3.1 django-phonenumber-field~=7.3.0 @@ -22,5 +23,4 @@ python-magic~=0.4.27 requests~=2.31.0 sympasoap~=1.1 uvicorn~=0.25.0 -websockets~=12.0 -whoosh~=2.7.4 \ No newline at end of file +websockets~=12.0 \ No newline at end of file diff --git a/tfjm/settings.py b/tfjm/settings.py index 9874ae9..12321e8 100644 --- a/tfjm/settings.py +++ b/tfjm/settings.py @@ -203,8 +203,9 @@ DJANGO_TABLES2_TEMPLATE = 'django_tables2/bootstrap5.html' HAYSTACK_CONNECTIONS = { 'default': { - 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', - 'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'), + 'ENGINE': 'haystack.backends.elasticsearch7_backend.Elasticsearch7SearchEngine', + 'URL': 'http://elasticsearch:9200/', + 'INDEX_NAME': 'haystack', } } diff --git a/tox.ini b/tox.ini index 4b786ff..5fc3821 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,6 @@ deps = pypdf~=3.17.4 python-magic~=0.4.27 requests~=2.31.0 - whoosh~=2.7.4 commands = coverage run --source=api,draw,logs,participation,registration,tfjm ./manage.py test api/ draw/ logs/ participation/ registration/ tfjm/