Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions definitions/v10/f1carreras-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ search:
keywordsfilters:
- name: re_replace
args: ["\\.", " "]
- 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
Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Author

@tiramisuflavor tiramisuflavor Mar 10, 2025

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

Copy link
Contributor

@ilike2burnthing ilike2burnthing Aug 16, 2025

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.

# - name: re_replace # S2024 to 2024 and S2024E97 to 2024 97
# args: ["\\b(?:S(\\d{2,4}))(?:E(\\d{2,4}))?\\b", "$1 $2"]
- name: trim

rows:
Expand Down