Honor exact= in the product filter - #226
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
GET /db/{db}/activities?product=X&exact=trueignoredexactfor 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 (exactabsent or false) is unchanged.Verification
New
StructuredFiltersSpecpins the contract: full-name match only, case-insensitive, partial name rejected, combined name+product exact filter. Full test suite green.