Include group names in member search closing #375 #426
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
optional
question
S
UX research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: local-it/mitgliederverwaltung#426
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/groups-search-integration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description of the implemented changes
The changes were:
Include group names in member search (Issue #375). Searching for a group name (e.g. "Vorstand" or "Board Members") in the existing member search now returns all members who belong to a group with that name. No new UI; the existing search box uses an updated
search_vectorand DB triggers.What has been changed?
Database (new migration
20260217120000_add_group_names_to_member_search_vector.exs):members_search_vector_trigger()now adds the member’s group names (frommember_groups→groups) tosearch_vectorwith weight B (same as notes).member_groups:update_member_search_vector_on_member_groups_changeruns on INSERT/UPDATE/DELETE and refreshes the affected member’ssearch_vectorso it stays in sync when members are added to or removed from groups.update_member_search_vector_from_custom_field_value()updated to include group names when recomputing after custom field changes.members.search_vectorso existing members are searchable by group name. Down migration restores previous trigger logic and backfills without group names.Tests:
test/membership/member_search_groups_integration_test.exs– search by group name, multiple groups, no false positives, search vector updates on add/remove (INSERT/DELETE onmember_groups), partial/special-character cases, and authorization (actor only sees allowed members). One test uses a member name that does not overlap the group name so the “remove from group” case is not matched by trigram on first/last name.test/mv_web/member_live/index_groups_integration_test.exs– includes the “member index search by group name returns members in that group” scenario (and any related integration tests you added there).Documentation:
search_vector(no Elixir change).No application/Elixir search code changes:
Member.fuzzy_search/2and the:searchaction already usesearch_vector(FTS); group names are included once the triggers and backfill are in place.Definition of Done
Code Quality
mix formatrun)Accessibility
Testing
Additional Notes
NEW/OLDonmember_groups, backfill and down), and that the new integration tests cover the intended behaviour (search by group name, add/remove membership, authorization).search_vector(group names) drives the result after removal.member_groupstable (already on main via #371/#378). No dependency on #374 (member detail groups) for the search behaviour itself.