Search-bar and filtering in tutor-dev

Hello Everyone,

  • I want to use search-bar and filtering feature in tutor-dev.
  • I set the
FEATURES: 
  ENABLE_COURSE_DISCOVERY: true 
  ENABLE_COURSEWARE_SEARCH: true

variables in the tutor/env/apps/openedx/config/lms.env.yml file.

  • I also added
FEATURES["ENABLE_COURSEWARE_SEARCH"] = True FEATURES["ENABLE_COURSE_DISCOVERY"] = True

to the tutor/env/apps/openedx/settings/lms/development.py file.
While search-bar and filtering work for tutor local, these features do not work for tutor dev. Is there a step I skipped or made wrong? Thank you.

Hi @burkay

To enable it, tried to create a plugin file called coursewaresearch.yml.

mkdir -p "$(tutor plugins printroot)"
nano "$(tutor plugins printroot)"/coursewaresearch.yml

Then put script below into coursewaresearch.yml.

name: coursewaresearch
version: 0.1.0
patches:
  lms-env-features: |
    "ENABLE_COURSEWARE_SEARCH": true,
    "ENABLE_COURSE_DISCOVERY": true

After that, enable plugins dan restart LMS

tutor plugins enable coursewaresearch && tutor config save
tutor local restart lms
1 Like

@burkay welcome to the community. u need to create a simple plugin

mkdir -p "$(tutor plugins printroot)"

nano "$(tutor plugins printroot)/myplugin.py"

u can change the myplugin.py name as search.py and whatever u like

then simply add this

from tutor import hooks

hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-common-settings",
        """
FEATURES['ENABLE_COURSE_DISCOVERY'] = True
FEATURES['ENABLE_COURSEWARE_SEARCH'] = True
FEATURES['ENABLE_DASHBOARD_SEARCH'] = True

FEATURES['ENABLE_COURSEWARE_INDEX'] = True
FEATURES['ENABLE_LIBRARY_INDEX'] = True

"""
    )
)

tutor plugins enable myplugin
tutor config save
tutor dev start -d

then just simply hit if your tutor is installed with Olive so tutor dev launch other wise tutor dev quickstart
tutor plugins list is check whether a plugin is enabled or not
your search is now working

3 Likes

Thank you both very much for your answers. I tried Yagnesh’s answer and my problem was solved. I’ll try the other answer at a convenient time. I am grateful to both of you.