For this week I was once able to work on one more issue, despite my reservations about having enough time to work on a issue with couple final exams on the calendar this week.
Investigation
When I was looking for issues I found this issue interesting. The problem is when searching on the search bar the recommendations were the oldest talks, instead it would make more sense to just show newer talks. There was a recent PR that implemented a global search. I thought this issue was addressed since it uses spotlight search. But after some investigation I found the issue was still present. So I dove into the code base seeing that new global search uses something called spotlight search that uses turbo. So after some digging I found the talk controller under spotlight. After reading the code I realized I can just sort it by date
attribute and since it shows the first 5 it'd be the right fix.
Aftermath
So, I made my PR, one of the maintainer thanked me for the catch and recommended that I do the same for events since it shows the oldest events as well. So after the change I was waiting for further feedback. The owner mentioned that talks implementation for spotlight search can be made better. There is a scope called ranked
that uses the keyword presence in title and description to create ranking. It also made sense to show relevant results(ranked) rather than the first 5 of the newest talks. He also gave me suggestions on updating the implementation as well. They use BM25
algorithm to create the ranking. We could also include how old the talk is to update ranking. For example, we can penalize newer records using a scale. Another suggestion was to use talk date as tie breaker when ranking(bm25 score) is the same.
I tried the first recommended scope and I still got the newest records in all cases, while the second recommendation had a mix of newer and older records in some cases. I played around with the given multiplier for the first recommendation, but I didn't see any significant changes. So I informed the owner about my finding. He made a new PR to show me how the bm25 ranking works and updated the multiplier as well. In my testing I went as far as 0.000001
but in the PR I noticed he used 0.000000001
. And I did notice better results. After the update, and some waiting my PR was merged.
Finish Line
This was a great experience. Working in production ready codebase lends to a great learning opportunity. Knowing Git and GitHub made my life a lot easier. I'm proud of what I was able to accomplish in just 4 months. I got to interact with a lot of new codebase and was genuinely surprised how nice everyone was. Although sometimes waiting for the response was a bit boring but it was really nice. Looking at previous PRs is also a great help on how the code base in handled and how the code is written. Overall, it was pretty good.
Top comments (0)