diff --git a/changelog.d/20241017_233457_regis_meilisearch.md b/changelog.d/20241017_233457_regis_meilisearch.md index e21cac3..33808d4 100644 --- a/changelog.d/20241017_233457_regis_meilisearch.md +++ b/changelog.d/20241017_233457_regis_meilisearch.md @@ -1 +1,2 @@ - [Bugfix] Actually mount edx-notes-api repositories from host on `tutor mounts add /path/to/edx-notes-api`. (by @regisb) +- 💥[Feature] Replace Elasticsearch by Meilisearch. The implementation is much more compact and readable. All content will be automatically re-indexed during init. (by @regisb) diff --git a/tutornotes/templates/notes/apps/settings/tutor.py b/tutornotes/templates/notes/apps/settings/tutor.py index 35b0b34..be75dd4 100644 --- a/tutornotes/templates/notes/apps/settings/tutor.py +++ b/tutornotes/templates/notes/apps/settings/tutor.py @@ -23,11 +23,12 @@ CLIENT_ID = "notes" CLIENT_SECRET = "{{ NOTES_OAUTH2_SECRET }}" -ELASTICSEARCH_DSL = { - 'default': { - 'hosts': '{{ ELASTICSEARCH_SCHEME }}://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}' - } -} +# Meilisearch credentials +ES_DISABLED = True +MEILISEARCH_ENABLED = True +MEILISEARCH_URL = "{{ MEILISEARCH_URL }}" +MEILISEARCH_API_KEY = "{{ MEILISEARCH_API_KEY }}" +MEILISEARCH_INDEX = "{{ MEILISEARCH_INDEX_PREFIX }}student_notes" LOGGING = { "version": 1, diff --git a/tutornotes/templates/notes/tasks/notes/init b/tutornotes/templates/notes/tasks/notes/init index b0f3606..4d12a18 100644 --- a/tutornotes/templates/notes/tasks/notes/init +++ b/tutornotes/templates/notes/tasks/notes/init @@ -1,2 +1,4 @@ ./manage.py migrate -./manage.py search_index --rebuild -f + +# Re-index with meilisearch +./manage.py shell -c "from notesapi.v1.views.meilisearch import reindex; reindex()"