- Replace hasTags(List<String>) spec with hasTags(List<Set<UUID>>, useOr) - AND mode: one EXISTS subquery per expanded tag ID set; empty set = disjunction - OR mode: union of all expanded sets into a single EXISTS subquery - DocumentService calls tagService.expandTagNamesToDescendantIdSets() before building spec - DocumentController exposes ?tagOp=AND|OR query param (default AND) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>