-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
replace Fuse.js with Algolia for home user search #72
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added 2 comments, but overall LGTM
composer.json
Outdated
@@ -22,6 +23,7 @@ | |||
"laravel/framework": "^8.12", | |||
"laravel/horizon": "^5.7", | |||
"laravel/nova": "^3.22", | |||
"laravel/scout": "^8.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would encourage using scout-extended in order to be able to customize the specificities of Algolia.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point - will "switch". 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blocked by: laravel/framework#37080
In case you have some time @redox this is the PR to replace the current Fuse.js with Algolia & instantsearch.js
The daily re-index seems to be needed as blocked entities aren't part of the index but it's only an update call so the
laravel/scout
delete isn't called here. I will try to find a better solution.Okay, without a custom engine this won't work as https://github.com/laravel/scout/blob/7fb1c860a2fd904f0e084a7cc3641eb1448ba278/src/Engines/AlgoliaEngine.php#L46-L73 only calls
saveObjects()
. The observer https://github.com/laravel/scout/blob/7fb1c860a2fd904f0e084a7cc3641eb1448ba278/src/ModelObserver.php#L75-L88 also makes models unsearchable if they shouldn't be searchable anymore. But not the import command.Would like to know if it's bad practice to do a full daily re-index of the data? If it will consume my credits/units too fast? Or if that's okay? 🤔
EDIT: the
scout:reimport
command byalgolia/scout-extended
does the same in a lot nicer way. 🎉apply for second category of https://github.com/algolia/algolia-coding-contest
deployment commands: