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

Courses by subject not listed in numerical order #57

Open
joycelynmng opened this issue Feb 9, 2023 · 3 comments
Open

Courses by subject not listed in numerical order #57

joycelynmng opened this issue Feb 9, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@joycelynmng
Copy link

joycelynmng commented Feb 9, 2023

Currently, when you search for a subject and not a certain course it is hard to do because it is really messy and not numerically ordered it is random. In http://127.0.0.1:3000/subject-areas/142 it is okay but on the actual published website, it is not in order by course code.

Screenshot 2023-02-08 at 8 56 17 PM
Screenshot 2023-02-08 at 8 56 27 PM

@joycelynmng joycelynmng added the enhancement New feature or request label Feb 9, 2023
@joycelynmng joycelynmng changed the title Courses by subject not listed in alphabetical order Courses by subject not listed in numerical order Feb 15, 2023
@TimothyGu
Copy link
Member

This is not easily fixable. The second screenshot is the search results for the query "physics", where numerical order may not be the best order. Suppose if the COM SCI subject area has a class called "Physics in computer graphics", it is unclear where to slot that CS class relative to the physics classes in the search results.

@joycelynmng
Copy link
Author

Would it be possible to change it so that in the second slide when you are searching for just course subject names such as "physics" the course subject area pops up so that it is already in numerical order? When people search up a key term like "physics" or "math" its usually to look up the whole subject area as they are looking to browse through the course offerings within that subject area. This way people will not have to go to the registrar to look up each course code and then come back to hotseat. Additionally they would not have to navigate back to the home page to select the course subject area if they are looking for a different subject.

@TimothyGu
Copy link
Member

Yeah, I think that'd be a good idea. We could have the search page return subject areas as well (much like how we already have instructor and courses show up on the same page), and make sure the subject areas display on the page before courses. That seems to be more doable.

Do you want to take a stab at it? Nathan probably knows how this works better, but I believe this requires adding a few lines like these to subject_area.rb:

searchkick word_middle: [:search_text], default_fields: [:search_text]

sig { returns(T::Hash[Symbol, String]) }
def search_data
search_text = "#{subject_area.code} #{subject_area.name} #{number} #{title}" if superseding_course_with_subject.nil?
{
search_text:,
}
end

These lines would add subject areas to the search index, and also dictate how the subject area is to be displayed on the search page (e.g., "COM SCI: Computer Science").

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

No branches or pull requests

2 participants