Implements search for custom fields closes #196 #266

Merged
moritz merged 11 commits from feature/196_search_custom_fields into main 2025-12-11 14:07:42 +01:00
Owner

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

What has been changed?

  • adds custom fields to ts vector
  • updates tsvector column on custom field changes

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed
  • Documentation is added were needed

Accessibility

  • New elements are properly defined with html-tags
  • Colour contrast follows WCAG criteria
  • Aria labels are added when needed
  • Everything is accessible by keyboard
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written
  • All tests pass
  • axe-core dev tools show no critical or major issues

Additional Notes

  • Seraching for substrings is sometimes not working, maybe we should have a look on that
  • I added two issues I linked in the issue of this PR
  • For large datasets this could be a performance issue --> mentioned in created issue
## Description of the implemented changes The changes were: - [ ] Bugfixing - [x] New Feature - [ ] Breaking Change - [ ] Refactoring ## What has been changed? - adds custom fields to ts vector - updates tsvector column on custom field changes ## Definition of Done ### Code Quality - [x] No new technical depths - [x] Linting passed - [x] Documentation is added were needed ### Accessibility - [ ] New elements are properly defined with html-tags - [ ] Colour contrast follows WCAG criteria - [ ] Aria labels are added when needed - [ ] Everything is accessible by keyboard - [ ] Tab-Order is comprehensible - [ ] All interactive elements have a visible focus ### Testing - [x] Tests for new code are written - [x] All tests pass - [x] axe-core dev tools show no critical or major issues ## Additional Notes - Seraching for substrings is sometimes not working, maybe we should have a look on that - I added two issues I linked in the issue of this PR - For large datasets this could be a performance issue --> mentioned in created issue
carla added 4 commits 2025-12-04 15:52:05 +01:00
carla changed title from WIP: Implements search for custom fields to Implements search for custom fields 2025-12-04 15:52:11 +01:00
carla changed title from Implements search for custom fields to Implements search for custom fields closes #196 2025-12-08 11:53:34 +01:00
requested review from moritz 2025-12-11 00:48:49 +01:00
moritz force-pushed feature/196_search_custom_fields from 9960089be5 to c204d25c73 2025-12-11 01:05:37 +01:00 Compare
moritz force-pushed feature/196_search_custom_fields from c204d25c73 to 014ef04853 2025-12-11 13:44:35 +01:00 Compare
moritz added 6 commits 2025-12-11 13:51:53 +01:00
- Replace 4 LIKE checks with 2 in build_custom_field_filter
- Simplify CASE blocks in migration trigger functions
- ->> operator always returns text, no need for -> + ::text fallback
- Performance improvement: 50% fewer LIKE operations
contains(city, ^query) already produces ILIKE '%query%'
ilike(city, ^pattern) with pattern="%query%" is identical
Explain the two-tier matching approach:
- % operator with server-wide threshold (0.3) for fast index scans
- similarity functions with configurable threshold (0.2) for edge cases
Add rationale for threshold value based on German name testing
The fields parameter was accepted but never used in the :search action.
Simplify API to only accept the query parameter.
Update @doc to reflect the actual functionality.
Custom field LIKE queries on JSONB are expensive (no index).
User linking only needs name/email search for autocomplete.
Custom fields are still searchable via main member search (uses FTS index).
Remove unnecessary credo:disable as function complexity is now acceptable.
security: add input sanitization for search queries
All checks were successful
continuous-integration/drone/push Build is passing
ca5fad0dcc
- Escape SQL LIKE wildcards (% and _) to prevent pattern injection
- Limit search query length to 100 characters
- Apply sanitization in both :search action and linking filters
- FTS and fuzzy search use unsanitized query (wildcards not special there)
moritz added 1 commit 2025-12-11 14:04:26 +01:00
fix: custom field substring search - pass id as parameter
All checks were successful
continuous-integration/drone/push Build is passing
00fe471bc0
Fragment 'member_id = id' did not resolve correctly. Now passes id as
Ash expression. Also changed LIKE to ILIKE for case-insensitive search.
moritz merged commit d5ac168add into main 2025-12-11 14:07:42 +01:00
moritz deleted branch feature/196_search_custom_fields 2025-12-11 14:07:43 +01:00
Sign in to join this conversation.
No description provided.