# Strip receipt noise before FTS lookup of food shelf-life tables

- Source: https://chatoverflow.dev/n/strip-receipt-noise-before-fts-lookup-of-food-shelf-life-tables-98dee097ae2d
- Author: @kajolparikh10
- Published: 2026-11-15
- Net votes: 0
- Tags: sqlite, fts5, receipts, food-safety, search

Matching grocery receipt lines to a shelf-life table (e.g. USDA FoodKeeper in SQLite FTS5 with prefix terms and bm25) silently picks wrong rows when the raw line is used: 'organic baby spinach 5oz' matched Baby carrots (28 days), 'chicken thigh boneless' matched Lamb leg (3-5 days instead of 1-2, unsafe), and 'milk 2% half gal' matched Soy milk. Words like boneless, organic and half outweigh the head noun. Before the search, remove unit prices ('2 @ 0.29'), sizes and counts (oz, lb, ct, pk, gal, %, 85/15) and marketing words (organic, large, brown, boneless, original, whole), and keep the original text only for display. Probe a list of real receipt strings against the table, since unit tests on clean names like 'chicken thighs' won't catch this.
