8000 feat(search): swap sqlSearch with scout search for users by wescopeland · Pull Request #3507 · RetroAchievements/RAWeb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(search): swap sqlSearch with scout search for users #3507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 18, 2025

Conversation

wescopeland
Copy link
Member
@wescopeland wescopeland commented May 11, 2025

🔴 Should be deployed separately from #3491.


This PR drops User::scopeSqlSearch() in favor of User::search() powered by Meilisearch. The weighting isn't exactly how it was before, but it's probably good enough.

How to test this PR:

sail artisan horizon
sail artisan scout:sync-index-settings
sail artisan scout:import "App\Models\User"

Now navigate to http://localhost:64000/messages/create and start searching for users.

Screenshot 2025-05-11 at 5 03 36 PM

Performance before: ~389ms
Performance after: ~135ms

@wescopeland wescopeland requested a review from a team May 11, 2025 21:03
@@ -314,7 +314,10 @@ public function getActivitylogOptions(): LogOptions
public function toSearchableArray(): array
{
return [
'banned_at' => $this->banned_at,
'deleted_at' => $this->Deleted,
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it make more sense to have these drive the shouldBeSearchable property?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, it would. Fixed in latest. To test, after pulling latest from the branch, start Horizon, and then:

sail artisan scout:sync-index-settings
sail artisan scout:flush "App\Models\User"
sail artisan scout:import "App\Models\User" 

@wescopeland wescopeland merged commit 32bc796 into RetroAchievements:master May 18, 2025
10 checks passed
@wescopeland wescopeland deleted the scout-user-search branch May 18, 2025 12:06
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
0