Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Populate search index (Algolia) via a GitHub Action #444

Open
aomi opened this issue Feb 14, 2023 · 0 comments · May be fixed by #488
Open

feature: Populate search index (Algolia) via a GitHub Action #444

aomi opened this issue Feb 14, 2023 · 0 comments · May be fixed by #488
Assignees

Comments

@aomi
Copy link
Member

aomi commented Feb 14, 2023

Currently, the search feature uses Algolia under the hood.

In order to capture new courses, the search index must be updated periodically otherwise new courses will not show up in search while showing up when manually navigating courses.

Each record in the index should be shaped like the following:

{
      "subjectCode": "PAAS342",
      "subject": "PAAS",
      "code": "342",
      "pid": "BJm2a_pXV",
      "description": "For students who wish to expand their working vocabulary and develop their skills in reading modern Japanese. Course content may vary from year to year.",
      "title": "Advanced Readings in Japanese II"
}

https://www.algolia.com/doc/api-client/methods/indexing/

Records can either be added or updated. Each record in the index requires a unique id. If an id is given when creating records in the index it will be used, otherwise it will be given a generated one.

https://www.algolia.com/doc/api-reference/api-methods/save-objects/?client=javascript

The script should take the current courses (hitting the courseup API probably) and transform the values to match the above object shape. Whether to update records or purge the index and create records from scratch will require some work and research on the developer.

Historically, the pid is usually consistent between terms but it's not a guarantee. As such it may make sense to add term to list of attributes indexed, this would allow searching between terms and do things like searching for courses via extended attributes like class_in_session etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants