-
-
Notifications
You must be signed in to change notification settings - Fork 92
F1Carreras : Update keyword filter for improved search accuracy #527
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
base: master
Are you sure you want to change the base?
F1Carreras : Update keyword filter for improved search accuracy #527
Conversation
definitions/v10/f1carreras-api.yml
Outdated
| - name: re_replace # S2024 to 2024 and S2024E97 to 2024 97 | ||
| args: ["\\b(?:S(\\d{2,4}))(?:E(\\d{2,4}))?\\b", "$1 $2"] | ||
| # disabled to find better matches as agreed on F1Carreras Discord | ||
| # searching for "Formula1 2024 97" returns nothing, but "Formula1 S2024E97" works just fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an workaround for both Formula1 S2024E97 and Formula1 2024x97 formats. Unless 2024x97 is not being used at all, your change breaks matching both formats.
Sadly when I pushed the change it worked fine for both AFAIK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you review and insights. Let me collect some data and see if there’s any better alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been playing around with the meilisearch engine they have and finally found a way to get both formats working. It's not very intuitive, but it's the price of a full-text search mechanism.
Example Inputs & Expected Outputs:
| Input | Step 1 (SxxExx → SxxXxx) | Step 2 (Sxx → xx, if no x) | Final Output | Expected Results |
|---|---|---|---|---|
S2024E103 |
S2024x103 |
(unchanged) | S2024x103 |
S2024E103 and 2024x103 |
S2024 |
(unchanged) | 2024 |
2024 |
2024 Season Release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formula1 "S2024E97" returns 1 result - Formula1 S2024E97
Formula1 S2024x97 returns 1 result - Formula1 S2024E97 (same as ^)
Formula1 "2024x97" returns 1 result - Formula1 2024x97
Quotation marks seem to be required in some cases, as the tracker will return irrelevant results otherwise.
Doesn't look like there's a simple one size fits all fix for this. Best case scenario is going to be finding which returns the most results most of the time.
From a very quick look, I found that NTT "S2025e37" and NTT S2025x37 will return the same one response, but there's nothing for NTT "2025x37". You'd need to look at more examples.
Co-authored-by: ilike2burnthing <[email protected]>
Disabled regex to find better matches as agreed on F1Carreras Discord. Searching for "Formula1 2024 97" returns nothing, but "Formula1 S2024E97" works just fine.