SEARCH_SKIP_INVITATION_ONLY_FILTERING set to False causing "Unknown value type: <class 'bool'>" error on course search

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:

  1. Set SEARCH_SKIP_INVITATION_ONLY_FILTERING = False in your LMS settings.

  2. Navigate to the course discovery or search page.

  3. Search for any course.

  4. 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!

Hi @Darshan_Kotak when making posts, kindly indicate which version of Tutor you’re running. Also in this case, are you using the Catalog MFE?

Hi, thanks for the response!

I’m running Tutor on the Sumac version. And no, I’m not using the Catalog MFE.

Hmm. I’m having a bit of trouble finding this in the code. It seems to be a setting that is referenced only once. It can be the case, unfortunately, that a little-known flag that doesn’t seem to have any tests that test its behavior end up not working down the line.

One clue I got in a bit of digging is a potential reference to the flag, ENABLE_COURSEWARE_INDEX. Could you see if this flag is enabled, and if not, try setting it to True? if that does nothing, I would unfortunately suspect that the SEARCH_SKIP_INVITATION_ONLY_FILTERING flag stopped working at some point and should probably just be removed.

Actually, the pull request that added this has some more detail - [SE-4682] Removing invitation-only and non-catalog courses from search results by ha-D · Pull Request #28518 · openedx/openedx-platform · GitHub - check that out and see if the flags they mention are all set on your instance. Do report back, please.