ryanhugh / searchneu

Search over Classes, Professors and Employees at NEU!
https://searchneu.com
GNU Affero General Public License v3.0
74 stars 18 forks source link

Make different query if query is course code #120

Closed gamburgm closed 4 years ago

gamburgm commented 4 years ago

This change fixes multiple issues:

  1. the query bug where cs2501 returns different results from cs 2501. The reason this was happening is that the course_code analyzer was actually working, but because the name field doesn't have the word_delimiter filter, it parses the course code as a single token. Turns out the cs token in the query actually gives cs2501 a significant boost because it has the token CS in its title, which is the only reason it was showing up as first to begin with. Not good.

  2. removes the hackiness of the function score. It was only working by a delicate balance anyway, with a 0.4 factor on non-primary courses and small changes in boosts for different fields to get the numbers just right. Removes that entirely.

  3. making more intelligent queries altogether. If we know somebody's making a course code query, we should be doing two things: a. only query against subject and classId. b. the following results should all be of the same subject rather than having the same classId. For example, if you search for cs2500, you should get fundies 1 as the first result, then CS classes as the rest of your search results. Getting ENGL2500 would be very weird.

P.S. a few last things necessary before this goes out plus some general tests to throw in as well.

gamburgm commented 4 years ago

PR should be ready now, just need to do some manual testing and check that backend search speed doesn't take a massive hit.

ryanhugh commented 4 years ago

Looks great! Great work

ryanhugh commented 4 years ago

Also - this can be the last PR to this repo! 🤯 Use github.com/sandboxnu/searchneu from here on out 🥳

gamburgm commented 4 years ago

Also - this can be the last PR to this repo! 🤯 Use github.com/sandboxnu/searchneu from here on out 🥳

Actually gonna move this guy to the sandboxnu repo. 😄