Skip to content

feat: Improve season search priority ordering#48

Merged
sunr4y merged 2 commits into
developfrom
feature/search-secondary-teams-filter
Jan 23, 2026
Merged

feat: Improve season search priority ordering#48
sunr4y merged 2 commits into
developfrom
feature/search-secondary-teams-filter

Conversation

@sunr4y
Copy link
Copy Markdown
Owner

@sunr4y sunr4y commented Jan 23, 2026

Changes

  • Use first_year and second_year fields for simpler and more accurate season matching
  • Implement priority-based ordering for search results:
    1. Exact match (e.g., '2025' matches '2025')
    2. Starts with keyword (e.g., '2025' matches '2025-26' via first_year)
    3. Ends with keyword (e.g., '2025' matches '2024-25' via second_year)
    4. Contains keyword (e.g., '2025' matches '2025-27' via first_year or second_year)

Example

Searching for '2025' now returns results in the correct order:

  • '2025' (exact match)
  • '2025-26' (starts with)
  • '2024-25' (ends with)

Testing

  • All tests pass
  • New test added to verify priority ordering
  • Ruff checks pass

- Use first_year and second_year fields for simpler and more accurate matching
- Priority order: exact match > starts with (first_year) > ends with (second_year) > contains
- Add test to verify priority ordering works correctly
- Example: searching '2025' returns: '2025', '2025-26', '2024-25' in correct order
- Handle 2-digit year searches (e.g., '97' matches '1997')
- Priority order: first_year ends with > second_year ends with > contains
- Example: searching '97' returns '1997', '1996-97' before '1977', '1978'
- Fixes issue where '97' was matching years like '1976', '1977' incorrectly
@sunr4y sunr4y merged commit b50036c into develop Jan 23, 2026
2 checks passed
@sunr4y sunr4y deleted the feature/search-secondary-teams-filter branch January 27, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant