Skip to content

Add full-text user search and search UI#329

Merged
joseganora merged 2 commits into
stagingfrom
hotfix/WN-411
May 29, 2026
Merged

Add full-text user search and search UI#329
joseganora merged 2 commits into
stagingfrom
hotfix/WN-411

Conversation

@jajaramillo24
Copy link
Copy Markdown
Collaborator

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.

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.

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)';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove organisation

@joseganora joseganora merged commit 4954069 into staging May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants