nusmodifications / nusmodifications/nusmods

Elasticsearch indexing does not include the numeric code only

Open
#4,394 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
689
Forks
364
Avg merge
7h 5m
Merged PRs (30d)
14

Description

Describe the bug

Elasticsearch indexing currently allows for fuzzy matching, but does not match the numeric code only. E.g. for module ST2334, Elasticsearch matches for "S2334" and "T2334", but fails to match for "2334".

To Reproduce

Steps to reproduce the behavior:

  1. Go to /courses
  2. In the search box, type "2334".
  3. You will see "No results found for 2334."
Expected behavior

I suggest an improvement to allow Elasticsearch to index by the numeric code as well.

Additional context

This may require reindexing modules_v2 after the fix in order for Elasticsearch to update its indexing.

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 at the /courses search flow and trace the Elasticsearch indexing and query configuration for modules_v2. Reproduce the missing numeric-only match with module ST2334, then verify that searching "2334" returns it and determine whether modules_v2 must be reindexed after the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, javascript
Domain
backend, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.