Search eval sweep
@slashclone/search-eval-sweep
Measure search quality with a fixed set of real queries: hits, misses, and false positives at the current cutoff and across a sweep of cutoffs, so ranking and threshold changes are chosen from data instead of guesses. Works for keyword, semantic, or hybrid search.
SkillDatav0.1.0 (latest)
- Activity
- New: be the first to try it
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1---
- 2name: search-eval-sweep
- 3description: Build a small search evaluation (real queries, expected results, nonsense queries) and a script that reports hits, misses, and false positives across score cutoffs. Use before tuning search ranking or a minimum match score.
- 4---
- 6# Search evaluation sweep
- 8Search changes feel better or worse depending on the last query you tried. An evaluation set makes them measurable.
- 10## The set (`search-eval-set.json`)
- 12- **Relevant queries:** 25 to 50 phrasings real people would type, each with the results they would be happy to see. Include plain-language needs ("my build failed, what went wrong"), not just product words.
- 13- **Nonsense queries:** five or more that should return nothing ("purple elephant banana keyboard").
- 14- Add a case every time someone reports a bad search.
- 16## The script
- 181. Run each query through the same code path the search page uses, including any minimum score filter.
- 192. A **hit** is an expected result in the top 5. A **false positive** is any result for a nonsense query.
- 203. Print one line per query: hit or miss, result count, best similarity, and the top result.
- 214. **Sweep** the cutoff (for example 0.1 to 0.4) and print hits, misses, and false positives at each, so the cutoff is picked from the table.
- 225. Cache query embeddings in a file outside the repo, so reruns cost nothing and respect provider rate limits.
- 236. Never print API keys, database URLs, or raw vectors.
- 25## Reading the results
- 27- A miss where the expected result is ranked first but filtered out is a **score** problem (cutoff or how the score blends evidence), not a ranking problem.
- 28- A miss where the result is absent is a **retrieval** problem (vocabulary, embeddings, or indexing).
- 29- Only ship a change when hits go up and false positives stay at zero.
