Unified Search Demo

How It Works

Single search bar - Type anything related to sports!

Example Searches:

1. Search "max v" Results:

  • Max Verstappen (Formula 1, Red Bull Racing) #33 • Dutch
    • Badges: Formula 1, IGTC

2. Search "formula" Results:

  • Formula 1 (Sport)
    • Badges: Racing, Motorsport

3. Search "red bull" Results:

  • Red Bull Racing (Team, Formula 1)
    • Founded 2005 • Austria

4. Search "john smith" (Disambiguation Example) Results:

  • John Smith (Formula 1 Driver, Example Racing) #88 • British
  • John Smith (NFL Wide Receiver, Example FC) #15 • American

What Happens When You Click:

  1. Click on Max Verstappen

    • Shows banner: "Max Verstappen | Formula 1 • Red Bull Racing"
    • Loads ALL his events:
      • 24 F1 races (from Ergast API)
      • 2 IGTC endurance races
    • Total: ~26 upcoming events
  2. Click on Formula 1

    • Shows banner: "Formula 1"
    • Loads all 2026 F1 races
    • Total: ~24 upcoming races
  3. Click on Red Bull Racing

    • Shows banner: "Red Bull Racing | Formula 1"
    • Loads all F1 races (team participates in all)
    • Total: ~24 upcoming races

Search Algorithm

Searches across 3 entity types simultaneously:

  1. Sports - matches name and categories
  2. Teams - matches team name
  3. Athletes - matches athlete name

All results combined and displayed with:

  • Avatar (initials)
  • Name (bold)
  • Sport (colored)
  • Details (team, nationality, number, position)
  • Category badges (for multi-sport athletes)

URL Structure

Frontend calls: /api/search.ts?query=max+v

Backend returns:

{ "results": [ { "id": "athlete_f1_verstappen_33", "type": "athlete", "name": "Max Verstappen", "sport": "Formula 1", "team": "Red Bull Racing", "metadata": { "nationality": "Dutch", "carNumber": "33" }, "categories": ["Formula 1", "IGTC"] } ], "count": 1 }

Benefits

No confusion - One search bar, intuitive ✅ Fast - Autocomplete as you type (300ms debounce) ✅ Smart - Searches everything at once ✅ Disambiguation - Shows multiple John Smiths clearly ✅ Multi-sport - Max's F1 + IGTC events combined