Search Evolution Explorer

Show the newest listings first

  1. 1
    Start simple

    Go through every listing and keep the ones whose text contains the query word. Order the kept listings newest first.

  2. 2
    Where it breaks

    'couch' finds couch listings but no sofa-only listing: this chapter has no word switches yet, so nothing bridges the gap between the two words. 'carpet' finds carpet listings but no rug that is titled 'rug'. And a fresh but weak match outranks the best match, because only age decides the order. Before you press, guess: for 'carpet', will it find one listing — or every rug?

  3. 3
    The fix

    Build a word table once, ahead of time: for every word, the listings that contain it. Look the query words up exactly as typed: keep only listings that contain every query word, then order them newest first.

  4. 4
    What it is called

    The word table is an inverted indexA table built once, ahead of time: for every word, the list of listings that contain it. Like the index at the back of a book. A query then looks up its words instead of scanning every listing.. Ordering by age only is recency ranking. Chapter 2 adds three switches that change which words are looked up: stemmingCut a word to its stem, so that 'bikes', 'biking' and 'bike' all become 'bike' and match each other., synonym expansionAlso search for words with the same meaning, so 'couch' also finds 'sofa'. and variant normalisationTreat 'mid-century', 'mid century' and 'midcentury' as the same word.. WANDSThe public product-search dataset this app searches. It provides the catalog (42,994 products) and the human relevance grades (Exact, Partial, Irrelevant) for the evaluated queries. has no date, so the posted date here is a deterministic synthetic overlay column spread over 180 days: many listings share a date, and those ties fall to a stable id order rather than to a finer clock.

Checkpoint · end of chapter 1the answer key

Did chapter 1 make search better?

Loading the measured scorecard.

Next · chapter 2Meet the seller halfway on wordsContinue →

Chapter 1 in engineering terms

matchingscoring
Capability
Retrieve strict word matches and order them newest first.
Mechanism
TokeniseSplit a text into single lower-case words without punctuation. the query and require every word, exactly as typed, to appear in the listing. No stemmingCut a word to its stem, so that 'bikes', 'biking' and 'bike' all become 'bike' and match each other., no synonymsAlso search for words with the same meaning, so 'couch' also finds 'sofa'., no variant collapsingTreat 'mid-century', 'mid century' and 'midcentury' as the same word.. Order the strict matches newest first.
Trade-off
Strict matchingThe step that decides which listings are candidates at all. is predictable but brittle: a different word for the same thing finds nothing, and a plural finds no singular. Newest-first can bury the best match under a fresh but weaker one. WANDSThe public product-search dataset this app searches. It provides the catalog (42,994 products) and the human relevance grades (Exact, Partial, Irrelevant) for the evaluated queries. has no date, so the posted date is a deterministic synthetic overlay.
Fixes
Without a first ranker the book has nothing to run, so evaluation has no ranking to gradeA number from 0 to 3 that says how good one listing is for one query. Here it is the WANDS human label: Exact = 3, Partial = 1, Irrelevant = 0. 0 = useless, 3 = exactly what was asked for. The grades are the answer key; the click log is simulated from them..

Matching decides which listings are candidates. Scoring decides their order. This level changes both.Dotted words have a definition: hover or tap them.

Checked example

runnable inventory example
sofa

The simplest search keeps the listings that write the query word and orders them newest first. This loveseat enters the top 10 because its text contains 'sofa' and it is recent; relevance does not enter the order.

The code that just ranmatch looks the query words up in the inverted index with AND semantics, exactly as typed. score returns only the recency value.Numbered notes explain the lines that matter. Click any function the code calls to open it in place, and come back with one key.src/domain/levels/level-1-recency.tsRead it