Skip to content

Commit 5be8e62

Browse files
regisbDawoudSheraz
authored andcommitted
feat: migrate to Meilisearch
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.
1 parent fb0477a commit 5be8e62

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
- [Bugfix] Actually mount edx-notes-api repositories from host on `tutor mounts add /path/to/edx-notes-api`. (by @regisb)
2+
- 💥[Feature] Replace Elasticsearch by Meilisearch. The implementation is much more compact and readable. All content will be automatically re-indexed during init. (by @regisb)

tutornotes/templates/notes/apps/settings/tutor.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
CLIENT_ID = "notes"
2424
CLIENT_SECRET = "{{ NOTES_OAUTH2_SECRET }}"
2525

26-
ELASTICSEARCH_DSL = {
27-
'default': {
28-
'hosts': '{{ ELASTICSEARCH_SCHEME }}://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}'
29-
}
30-
}
26+
# Meilisearch credentials
27+
ES_DISABLED = True
28+
MEILISEARCH_ENABLED = True
29+
MEILISEARCH_URL = "{{ MEILISEARCH_URL }}"
30+
MEILISEARCH_API_KEY = "{{ MEILISEARCH_API_KEY }}"
31+
MEILISEARCH_INDEX = "{{ MEILISEARCH_INDEX_PREFIX }}student_notes"
3132

3233
LOGGING = {
3334
"version": 1,

tutornotes/templates/notes/build/notes/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ USER ${APP_USER_ID}
2828
RUN git clone {{ NOTES_REPOSITORY }} --branch {{ NOTES_REPOSITORY_VERSION }} --depth 1 /app/edx-notes-api
2929
WORKDIR /app/edx-notes-api
3030

31+
# TODO remove after PR is merged
32+
# https://github.com/openedx/edx-notes-api/pull/444
33+
RUN git remote add regisb https://github.com/regisb/edx-notes-api \
34+
&& git fetch regisb regisb/meilisearch \
35+
&& git merge regisb/regisb/meilisearch
36+
3137
###### Install python venv ######
3238
RUN python -m venv /app/venv
3339
ENV PATH=/app/venv/bin:${PATH}
+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
./manage.py migrate
2-
./manage.py search_index --rebuild -f
2+
3+
# Re-index with meilisearch
4+
./manage.py shell -c "from notesapi.v1.views.meilisearch import reindex; reindex()"

0 commit comments

Comments
 (0)