Skip to content

feat: answer what is like this section or instructor - #641

Draft
jaspermayone wants to merge 1 commit into
feature/semantic-catalog-searchfrom
feature/similar-catalog-records
Draft

jaspermayone wants to merge 1 commit into
feature/semantic-catalog-searchfrom
feature/similar-catalog-records

Conversation

@jaspermayone

@jaspermayone jaspermayone commented Sep 19, 2026

Copy link
Copy Markdown
Member

Part of #453. Stacked on #640.

Two endpoints that answer "what is like this one?":

curl "…/api/v1/catalog/sections/17294/similar?limit=5"
curl "…/api/v1/catalog/instructors/fac_kw7coe30/similar"

and the same on GraphQL:

{ section(crn: 17294) { similar(limit: 5) { crn title } } }

Two choices worth reviewing:

  • Similar sections stay in the section's own term. A student picks from
    what is offered now, and the same course in another term carries identical
    text, so it would always win.
  • The other sections of the same course are left out. COMP 1050-02 is the
    nearest thing to COMP 1050-01 and the least useful answer to the question.

limit is 10 by default and 50 at most, in both surfaces. The GraphQL fields
carry complexity: 10 and a @listSize directive, because each one runs its
own vector query; the published cost stays honest.

The list is empty until the record has a vector, which the nightly backfill
writes.

Tests

bundle exec rspec is green locally (1552 examples), including the empty
cases, the limits, and the 404s.

Stack created with GitHub Stacks CLIGive Feedback 💬

Adds /api/v1/catalog/sections/:crn/similar and
/api/v1/catalog/instructors/:pub_id/similar, plus a similar field on
both GraphQL types. Similar sections stay in the same term and leave out
the other sections of the same course, which would otherwise fill the
list with what the student is already reading.
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 this pull request may close these issues.

1 participant