Skip to content

Commit

Permalink
feat: migrate to Meilisearch
Browse files Browse the repository at this point in the history
We make use of a new search engine to search annotations. The index will
automatically be created and filled during init. This is considered a
breaking change if you have customised your notes index.
  • Loading branch information
regisb authored and DawoudSheraz committed Nov 29, 2024
1 parent a61e09c commit 6e8bc34
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.d/20241017_233457_regis_meilisearch.md
Original file line number Diff line number Diff line change
@@ -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)
11 changes: 6 additions & 5 deletions tutornotes/templates/notes/apps/settings/tutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion tutornotes/templates/notes/tasks/notes/init
Original file line number Diff line number Diff line change
@@ -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()"

0 comments on commit 6e8bc34

Please sign in to comment.