Skip to content

Commit

Permalink
fix: include catalog_visibility filter in courseware_content
Browse files Browse the repository at this point in the history
The catalog_visibility filter is passed to the courseware_content index
when performing a search using the legacy student dashboard view. If not
included an error like follows is raised:

    MeilisearchApiError. Error code: invalid_search_filter. Error message:
    Attribute `catalog_visibility` is not filterable
  • Loading branch information
MoisesGSalas committed Dec 12, 2024
1 parent 28fa16a commit 940622a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion search/meilisearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,14 @@
"language", # aggregate by language, mode, org
"modes",
"org",
"catalog_visibility", # exclude visibility="none"
"catalog_visibility", # used if not settings.SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING
"enrollment_end", # include only enrollable courses
],
getattr(settings, "COURSEWARE_CONTENT_INDEX_NAME", "courseware_content"): [
PRIMARY_KEY_FIELD_NAME, # exclude some specific documents based on ID
"course", # search courseware content by course
"org", # used during indexing
"catalog_visibility", # used if not settings.SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING
"start_date", # limit search to started courses
],
}
Expand Down

0 comments on commit 940622a

Please sign in to comment.