openedx / openedx/openedx-platform

Use search engine for authoring home search

Open
#37,512 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.2k
Forks
4.4k
Avg merge
6d 18h
Merged PRs (30d)
42

Description

Problem:
The search box on the authoring home page (not the one in the navigation bar) uses the following method:

@classmethod
def get_courses_matching_query(cls, query, course_overviews):
    """
    Return a queryset of CourseOverview objects filtered by the given query.

    Args:
        query: A required parameter that allows filtering based on the CourseOverview.
        course_overviews: A queryset of CourseOverview objects to filter.
    """
    return course_overviews.filter(
        Q(display_name__icontains=query) |
        Q(org__icontains=query) |
        Q(id__icontains=query)
    )

Source:
https://github.com/openedx/edx-platform/blob/900706b1e51f03f9b8ef642f715890385db9cad6/openedx/core/djangoapps/content/course_overviews/models.py#L714

Although this search is case-insensitive, it still requires typing the exact term contained in the searchable fields.
This makes the search not very intelligent, especially for course names that include codes or languages with accents.

Since we already have a search engine available, I think we should utilize it to enhance the search experience.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with get_courses_matching_query in openedx/core/djangoapps/content/course_overviews/models.py and trace how the authoring home page calls it. Then inspect the existing search-engine integration and determine how it can replace the current field filtering. Done means the authoring home search uses the search engine and improves matching for course codes and accented names.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.