Deleting a course fails to update the meilisearch index
Open
Beginner friendly
Nobody has claimed this yet.
Meilisearch backend
- Dominant language
- Python
- Stars
- 20
- Forks
- 57
- Avg merge
- 48m
- Merged PRs (30d)
- 1
Description
Deleting a course via the django command delete_course fails the meili part with:
`Attribute `course` is not filterable. Available filterable attribute patterns are: `catalog_visibility`, `enrollment_end`, `language`, `modes`, `org`.`
The course no longer appears in authoring but does still appear in https://{LMS}/courses.
Adding content to INDEX_FILTERABLES for course_info seems to fix the issue.
The stacktrace:
...
Are you sure you want to delete course course-v1:badorg+badcn+badcr? [y/N] y
Are you sure? This action cannot be undone! [y/N] y
2025-10-25 09:38:08,145 INFO 75 [xmodule.modulestore.split_mongo.split] [user None] [ip None] split.py:2610 - deleting course from split-mongo: c
ourse-v1:badorg+badcn+badcr
2025-10-25 09:38:08,168 INFO 75 [search.meilisearch] [user None] [ip None] meilisearch.py:195 - Search query: opt_params={'showRankingScore': Tru
e, 'filter': ['course = "course-v1:badorg+badcn+badcr"', 'org = "badorg"']}
2025-10-25 09:38:08,190 ERROR 75 [django.dispatch] [user None] [ip None] dispatcher.py:264 - Error calling listen_for_course_delete in Signal.sen
d_robust() (MeilisearchApiError. Error code: invalid_search_filter. Error message: Index `tutor_course_info`: Attribute `course` is not filterable. Available filterable attribute patterns are: `catalog_visibility`, `enrollment_end`, `language`, `modes`, `org`.
1:7 course = "course-v1:badorg+badcn+badcr". Hint: It might not be working because you're not up to date with the Meilisearch version that search
call requires. Error documentation: https://docs.meilisearch.com/errors#invalid_search_filter Error type: invalid_request)
Traceback (most recent call last):
File "/openedx/venv/lib/python3.11/site-packages/meilisearch/_httprequests.py", line 224, in __validate
request.raise_for_status()
File "/openedx/venv/lib/python3.11/site-packages/requests/models.py", line 1026, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://meilisearch:7700/indexes/tutor_course_info/search
...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the INDEX_FILTERABLES configuration for the course_info index and inspect the delete_course flow that queries Meilisearch. Reproduce the deletion against a course, then verify that the index accepts the course filter and that the deleted course no longer appears in the LMS courses search.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- search
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100