Skip to content

Honor exact= in the product filter - #226

Merged
ccomb merged 1 commit into
mainfrom
product-exact-filter
Jul 15, 2026
Merged

Honor exact= in the product filter#226
ccomb merged 1 commit into
mainfrom
product-exact-filter

Conversation

@ccomb

@ccomb ccomb commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Why

GET /db/{db}/activities?product=X&exact=true ignored exact for the product filter: it always word-infix matched, so an exact search could return near-miss substring matches — and pathologically, a short query word matching inside longer product names returned almost everything. The flag already meant case-insensitive equality for names and geographies; products were the odd one out.

What

When exact=true, the product filter is now a case-insensitive equality check (toCaseFold) against the activity's reference product names — the same rule names and geographies already follow. Substring mode (exact absent or false) is unchanged.

Verification

New StructuredFiltersSpec pins the contract: full-name match only, case-insensitive, partial name rejected, combined name+product exact filter. Full test suite green.

The exact-match flag turned the geo filter into equality and drove
exact name candidates, but the product filter ignored it entirely and
always word-infix matched — an exact search could return near-miss
substring matches the caller has no way to detect. The product filter
now applies the same case-insensitive equality rule as names and
geographies when exact=true. Substring mode is unchanged.
@ccomb
ccomb merged commit bd6fd10 into main Jul 15, 2026
9 checks passed
@ccomb
ccomb deleted the product-exact-filter branch July 15, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant