
AI Engineer Lesson 2 of 4
Why did the wrong game rank first?
Predict the ranking and reproduce a retrieval score by hand.
One query, two games
Every language group uses the same English example. Which record comes first for game? Write a prediction, then run these commands in the project directory.
go run . -lang en search 'game'
go run . -lang en search 'game nine draw'
Both records score one. A tie is resolved by sorting identifiers, so game six comes first. For the second query, game nine matches game, nine and draw. Game six matches only game.
3 game-9
1 game-6
Reproduce the score
The terms function lowercases input and keeps each distinct term once. The search function filters by language and counts query terms present in either title or body. Try game game game. Why is the score still one?
On your own. Compare searches for 32.Qc4 and 25...Qxc4. Predict what changes in the tokens and the results. Write a paraphrase that a human understands but the ranker misses. Keep the question, expected source and actual result for the final lesson.

For the game-nine record, the queries on the cards score one, two and three respectively. Count the red counters to check each score.
Transcript — Before running search, write down which article should come first. Then compare your prediction with the top result.
If you have found a mistake or a typo in this article, tell us about it
Comments (0)
Log in to leave a comment →
No comments yet. Be the first.