Got 0 results found when using course search in LMS (Koa native instance, discovery, elasticsearch)

Hi all,

I’m trying to use edx-search in an instance of Koa native, so I configured settings in /edx/app/edxapp/edx-platform/lms/envs/common.py file as follows:

'ENABLE_COURSE_DISCOVERY': True,
'ENABLE_COURSEWARE_SEARCH': True,
'ENABLE_DASHBOARD_SEARCH': True,
...
'COURSE_DISCOVERY_FILTERS': ["org", "language", "modes"], #(overwriting default)
'COURSE_DISCOVERY_MEANINGS': {
        "org": {
            "name": "Organization"
        },
        "modes": {
            "name": "Course Type",
            "terms": {
                "honor": "Honor",
                "verified": "Verified"
            }
        },
        "language": "en"
    },
SEARCH_ENGINE = None #(tested changing it to "search.elastic.ElasticSearchEngine" with same result as well)

And configured settings in /edx/app/edxapp/edx-platform/cms/envs/common.py file as follows:

ENABLE_COURSEWARE_INDEX = True
ENABLE_LIBRARY_INDEX = True
SEARCH_ENGINE = None #(tested changing it to "search.elastic.ElasticSearchEngine" with same result as well)

Then I restarted service and got a search bar in my_lms_site/dashboard and my_lms_site/courses pages, but it does not find any course by name:

  • In dashboard page, I am able to see all courses (four mock courses created for testing), but when I search using a course name, or one word expecting one or more results, it shows the messages "0 results found for “some_course_name” and “Sorry, no results were found.”

  • In courses page, I am not able to see any course and search result is "We couldn’t find any results for “some_course_name”. The “Refine Your Search” panel does not show any option.

In addition, I had this observations:

Is there something important I am missing? This is my first topic. Thanks in advance if you may guide me to a better understanding and feedback.

Hello @lm49 and welcome to the community!

Your settings are correct.

In order to get courses on the /courses page, you have to reindex them. After reindexing, you will be able to see the courses on the /courses page and your dashboard page search will also start working.

If you do not have many courses then you can manually reindex your course from the (studio side) course outline page, there will be one button of Reindex. And if you have many courses then you can also use this management command to reindex all your courses at once.

Optional:
The above will work if you have set the enrollment start date for the courses but if you do not want to add the enrollment start date then set SEARCH_SKIP_ENROLLMENT_START_DATE_FILTERING to True.
And if you are on native installation then you can set above all settings (which you have set in common.py) to /edx/etc/lms.yml and /edx/etc/studio.yml

4 Likes

Hi @jramnai, thank you for your answer, it helped me a lot. Reindexing the courses worked for search in /courses page!

In contrast, the /dashboard page still does not show results when searching courses where my user has been enrolled (0 results found). Now I am trying to figure out the reason, set ENABLE_COURSEWARE_SEARCH_FOR_COURSE_STAFF as true with no results. Do you have some advice for how can I find the cause?

About native installation settings, I have a few questions (I can’t find an answer, not sure if it worths another topic, if it is true, please let me know):
Do you know if all configuration parameters should work when placed in /edx/etc/lms.yml and /edx/etc/studio.yml only without exceptions, overriding all config.py settings when set? Is there no need to modify config.py files?

Thanks in advance if you may give me some advice.

That’s the idea, yes. All entries in those files get converted to runtime variables, and override the default environment variables in the LMS and Studio environments.

1 Like