feat: add groups to search vector
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
3f07de1276
commit
f6575319f7
6 changed files with 878 additions and 5 deletions
|
|
@ -233,16 +233,23 @@ Settings (1) → MembershipFeeType (0..1)
|
|||
## Full-Text Search
|
||||
|
||||
### Implementation
|
||||
- **Trigger:** `members_search_vector_trigger()`
|
||||
- **Function:** Automatically updates `search_vector` on INSERT/UPDATE
|
||||
- **Trigger:** `members_search_vector_trigger()` on `members` (INSERT/UPDATE)
|
||||
- **Trigger:** `update_member_search_vector_from_member_groups()` on `member_groups` (INSERT/UPDATE/DELETE)
|
||||
- **Function:** Automatically updates `search_vector` on member and member_groups changes
|
||||
- **Index Type:** GIN (Generalized Inverted Index)
|
||||
|
||||
### Weighted Fields
|
||||
- **Weight A (highest):** first_name, last_name
|
||||
- **Weight B:** email, notes
|
||||
- **Weight B:** email, notes, group names (from member_groups → groups)
|
||||
- **Weight C:** city, street, house_number, postal_code, custom_field_values
|
||||
- **Weight D (lowest):** join_date, exit_date
|
||||
|
||||
### Group Names in Search
|
||||
Group names are included in the member search vector so that searching for a group name (e.g. "Vorstand") finds all members in that group:
|
||||
- Group names are aggregated from `member_groups` joined with `groups` and receive weight 'B'
|
||||
- The trigger `update_member_search_vector_on_member_groups_change` runs on INSERT/UPDATE/DELETE on `member_groups` and refreshes the affected member's `search_vector`
|
||||
- See migration `20260217120000_add_group_names_to_member_search_vector.exs` (Issue #375)
|
||||
|
||||
### Custom Field Values in Search
|
||||
Custom field values are automatically included in the search vector:
|
||||
- All custom field values (string, integer, boolean, date, email) are aggregated and added to the search vector
|
||||
|
|
|
|||
|
|
@ -81,12 +81,13 @@
|
|||
- ✅ User-Member linking (optional 1:1)
|
||||
- ✅ Email synchronization between User and Member
|
||||
- ✅ **Bulk email copy** - Copy selected members' email addresses to clipboard (Issue #230)
|
||||
- ✅ **Groups** - Organize members into groups (PR #378, #382, closes #371, #372, 2026-01-27)
|
||||
- ✅ **Groups** - Organize members into groups (PR #378, #382, #423, closes #371, #372, #374, #375, 2026-01/02)
|
||||
- Many-to-many relationship with groups
|
||||
- Groups management UI (`/groups`)
|
||||
- Filter and sort by groups in member list
|
||||
- Per-group filter in member list: one row per group with All / Yes / No (All/Alle); URL params `group_<uuid>=in|not_in`
|
||||
- Groups displayed in member overview and detail views
|
||||
- Member search includes group names (search by group name finds members in that group; search_vector + trigger on member_groups)
|
||||
- ✅ **CSV Import** - Import members from CSV files (PR #359, #394, #395, closes #335, #336, #338, 2026-01-27)
|
||||
- Member field import
|
||||
- Custom field value import
|
||||
|
|
@ -97,6 +98,7 @@
|
|||
- ✅ [#162](https://git.local-it.org/local-it/mitgliederverwaltung/issues/162) - Fuzzy and substring search (closed 2025-11-12)
|
||||
- ✅ [#371](https://git.local-it.org/local-it/mitgliederverwaltung/issues/371) - Add groups resource (closed 2026-01-27)
|
||||
- ✅ [#372](https://git.local-it.org/local-it/mitgliederverwaltung/issues/372) - Groups Admin UI (closed 2026-01-27)
|
||||
- ✅ [#375](https://git.local-it.org/local-it/mitgliederverwaltung/issues/375) - Search Integration (group names in member search) (implemented 2026-02-17)
|
||||
- ✅ [#335](https://git.local-it.org/local-it/mitgliederverwaltung/issues/335) - CSV Import UI (closed 2026-01-27)
|
||||
- ✅ [#336](https://git.local-it.org/local-it/mitgliederverwaltung/issues/336) - Config for import limits (closed 2026-01-27)
|
||||
- ✅ [#338](https://git.local-it.org/local-it/mitgliederverwaltung/issues/338) - Custom field CSV import (closed 2026-01-27)
|
||||
|
|
|
|||
|
|
@ -975,9 +975,11 @@ Each functional unit can be implemented as a **separate issue**:
|
|||
### Issue 5: Search Integration
|
||||
**Type:** Backend
|
||||
**Estimation:** 2h
|
||||
**Status:** ✅ Implemented (migration `20260217120000_add_group_names_to_member_search_vector.exs`, Issue #375)
|
||||
|
||||
**Tasks:**
|
||||
- Update search vector trigger to include group names
|
||||
- Extend fuzzy search to search group names
|
||||
- Extend fuzzy search to search group names (via search_vector; no Elixir change needed)
|
||||
- Test search functionality
|
||||
|
||||
**Acceptance Criteria:**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue