Hi everyone,
I’m trying to hide invitation-only courses from the search results in Open edX. To achieve this, I set the SEARCH_SKIP_INVITATION_ONLY_FILTERING feature flag to False.
However, after making this change, whenever I try to search for a course, I get the following error:
“error”: “Unknown value type: <class ‘bool’>”
It seems like the search backend is not handling the boolean value correctly when this filter is disabled. This might be related to the search engine migration from Elasticsearch to Meilisearch - the boolean filter handling could have changed in that transition - though I could be wrong about this.
Steps to reproduce:
-
Set
SEARCH_SKIP_INVITATION_ONLY_FILTERING = Falsein your LMS settings. -
Navigate to the course discovery or search page.
-
Search for any course.
-
Observe the error in the response.
Expected behaviour: Invitation-only courses should be hidden from the search results without breaking the search functionality.
Actual behaviour: The search throws an "Unknown value type: <class 'bool'>" error and returns no results.
I believe the error originates from the following part of the codebase, and something in that logic needs to be updated to handle boolean values correctly:
Has anyone else encountered this issue? Is there a workaround or a fix for handling boolean values in the search filter? Any help would be greatly appreciated!
Thanks!