Skip searching by ID #122
Comments
Hey @milosevicn, the To prevent MeiliSearch from searching through all fields, consider extending the functionallity of this package and setting the |
@mmachatschek Sorry to disturb you, but I didn't want to open new issue for this. It might be related to my question up there. |
Hi @milosevicn, this package basically is a wrapper for the MeiliSearch PHP library and extends Laravel Scout. When adding documents "manually", all the magic that Scout provides e.g. adding new objects to the index or updating existing ones with specific fields etc. gets lost because you skip that steps. Is there a specific intention you have by adding documents manually? |
Thanks for replying @mmachatschek I have multitenancy app - two separate apps (landlord and tenant). Because of this, I am not able to use predefined Laravel Scout functionality to update docs automatically once something is added to database. That's why I'm using a webhook to inform my tenant app when something happened in database actually on landlord (on created/updated/deleted). I want to add those docs once I catch a webhook on tenant |
@milosevicn I think you could just do a |
Hello,
When creating
toSearchableArray
for a specific model, if there isn'tID
included in final array, I can't import the data usingphp artisan scout:import "App\Book"
. But if I includeID
, then it becomes available to search byID
also, which is behaviour I would like to escape. What is the right way to disable searching byID
?Example code:
The text was updated successfully, but these errors were encountered: