Add full-text user search and search UI#329
Merged
Merged
Conversation
Add full-text searching across users.email and user_profiles (first_name, last_name, organisation) with MATCH...AGAINST scoring, and expose a debounced search box in the users list UI. Changes include: request validation for filters.search; UserRepository.applySearchFilter to compute a search_score, filter results and order by relevance; safer profile ordering subquery to ignore deleted profiles and pick the latest profile; a migration to add MySQL FULLTEXT indexes; Vue list page updates (search input, debounce, styles, lifecycle cleanup); store changes to persist searchFilter and include it in API requests while ignoring stale requests; axios interceptor to properly handle cancelled requests; translation entries added for the search label/placeholder across locales; and a feature test asserting admin list sorting by profile last name. These changes improve search relevance and UX for user listing.
joseganora
approved these changes
May 29, 2026
|
|
||
| private function applySearchFilter(Builder $builder, string $search) | ||
| { | ||
| $profileMatch = 'MATCH(user_profiles.first_name, user_profiles.last_name, user_profiles.organisation) AGAINST (? IN NATURAL LANGUAGE MODE)'; |
Collaborator
There was a problem hiding this comment.
Remove filter by organization
| } | ||
|
|
||
| $this->dropIndexIfExists('user_profiles', 'user_profiles_search_fulltext'); | ||
| DB::statement('ALTER TABLE user_profiles ADD FULLTEXT user_profiles_search_fulltext(first_name, last_name, organisation)'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add full-text searching across users.email and user_profiles (first_name, last_name, organisation) with MATCH...AGAINST scoring, and expose a debounced search box in the users list UI. Changes include: request validation for filters.search; UserRepository.applySearchFilter to compute a search_score, filter results and order by relevance; safer profile ordering subquery to ignore deleted profiles and pick the latest profile; a migration to add MySQL FULLTEXT indexes; Vue list page updates (search input, debounce, styles, lifecycle cleanup); store changes to persist searchFilter and include it in API requests while ignoring stale requests; axios interceptor to properly handle cancelled requests; translation entries added for the search label/placeholder across locales; and a feature test asserting admin list sorting by profile last name. These changes improve search relevance and UX for user listing.