feat: search filters for faces detected and faces unassigned #1136

Merged
chris merged 4 commits from feat/search-face-filters into main 2026-10-12 11:33:28 +02:00
Owner

Summary

Adds two independent boolean filters to the media search (Filter & Sort menu, query-token based):

  • Faces detected (face:detected) — media with at least one live person face (discovery_results, domain_key=people, state not rejected/superseded)
  • Faces unassigned (face:unassigned) — media with a live face that has no live assignment (spec 048 anti-join on class_instance_occurrences, state accepted/tentative; owner_recognized alone is deliberately not used as unassigned marker)

Both are combinable (AND). Exposed as query tokens (case-insensitive key/value, identical duplicates rejected, distinct values combinable) and as repeatable face request param; tokens win via existing mergeFilters. Chips: Face: Detected / Face: Unassigned.

Changes

API — SearchQueryParser, SearchFilters, SearchService.filterRestriction, SearchController, SearchResponse Javadoc. No schema change (existing indexes cover both probes). OpenAPI contract updated (face param plus drift fix for missing mediaType/approval params).

Web — queryTokens.ts (face key + values), FilterSortMenu.svelte (two menuitemcheckbox toggles after the approval block, favorite pattern), search/+page.svelte (state, handlers, chips, badge, focus id, clear), timeline.ts (repeatable face param).

Verification

  • ./gradlew :apps:api:test --tests '*SearchQueryParserTest*' --tests '*SearchServiceTest*' — 79 tests, 0 failures (11 new face tests)
  • npm run test:unit — 93/93
  • npx playwright test tests/search-filters.spec.ts — 42/42 (3 new face tests)
  • npm run build + npm run check (0 errors, warnings on baseline)
## Summary Adds two independent boolean filters to the media search (Filter & Sort menu, query-token based): - **Faces detected** (`face:detected`) — media with at least one live person face (`discovery_results`, `domain_key=people`, state not `rejected`/`superseded`) - **Faces unassigned** (`face:unassigned`) — media with a live face that has no live assignment (spec 048 anti-join on `class_instance_occurrences`, state `accepted`/`tentative`; `owner_recognized` alone is deliberately not used as unassigned marker) Both are combinable (AND). Exposed as query tokens (case-insensitive key/value, identical duplicates rejected, distinct values combinable) and as repeatable `face` request param; tokens win via existing `mergeFilters`. Chips: Face: Detected / Face: Unassigned. ## Changes **API** — `SearchQueryParser`, `SearchFilters`, `SearchService.filterRestriction`, `SearchController`, `SearchResponse` Javadoc. No schema change (existing indexes cover both probes). OpenAPI contract updated (`face` param plus drift fix for missing `mediaType`/`approval` params). **Web** — `queryTokens.ts` (face key + values), `FilterSortMenu.svelte` (two `menuitemcheckbox` toggles after the approval block, favorite pattern), `search/+page.svelte` (state, handlers, chips, badge, focus id, clear), `timeline.ts` (repeatable face param). ## Verification - `./gradlew :apps:api:test --tests '*SearchQueryParserTest*' --tests '*SearchServiceTest*'` — 79 tests, 0 failures (11 new face tests) - `npm run test:unit` — 93/93 - `npx playwright test tests/search-filters.spec.ts` — 42/42 (3 new face tests) - `npm run build` + `npm run check` (0 errors, warnings on baseline)
Add two boolean media-search filters:
- face:detected - media with at least one live person face
  (discovery_results, domain_key=people, state not rejected/superseded)
- face:unassigned - media with a live face lacking any live
  assignment (spec 048 anti-join on class_instance_occurrences,
  state accepted/tentative)

Exposed as query token (case-insensitive key/value, identical
duplicates rejected, distinct values combinable) and repeatable
face request param; tokens win via mergeFilters. Chip summary via
generic filterSummary. OpenAPI contract updated (face plus
mediaType/approval drift fix). No schema change.
Add two independent checkbox toggles to the search Filter & Sort
menu (favorite checkbox pattern, after the approval block):
"Faces detected" (face:detected) and "Faces unassigned"
(face:unassigned). Query tokens in q remain the single source of
truth; chips Face: Detected / Face: Unassigned, badge count, clear
filters, focus id, repeatable face API param. Unit and E2E tests
added.
Merge branch 'feat/search-faces-filter-web' into feat/search-face-filters
Some checks failed
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Failing after 18m20s
071198edf4
chris merged commit 95cda150a6 into main 2026-10-12 11:33:28 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1136
No description provided.