You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.
I wanted to use this package so that I can use the benefit of Laravel Scout with MySql FULLTEXT. Instead of using raw full text query I used this package so that in future I can easily change the driver and if needed can use more efficient Search driver like elasticsearch, TNTSearch or algolia.
I found many issue while installing and implementing it. But in the end I was able to install it successfully. For someone who may need this-
First, DamianTW\MySQLScout\Providers\MySQLScoutServiceProvider::class, did not work for me it was showing error on running command. So I changes it to Yab\MySQLScout\Providers\MySQLScoutServiceProvider::class,
The command php artisan scout:mysql-index App\\Post didn't work for me. I changed it to php artisan scout:mysql-index App\Post . May be I am using windows ?
Now to allow only few selected table columns you should override toSearchableArray() method in your model before running above command.
Note if you already have FULLTEXT defined in your table then you can match the above value in searchableAs() and toSearchableArray() methods by providing exact same values.
Hope this help someone.
Let me know if it can be improved further or I need to make any correction
The text was updated successfully, but these errors were encountered:
@sanjayojha, @damiantw, I did configure the toSearchableArray() with the specific fields I want to be searchable. Is there any reason why the package still needs to make queries to information_schema and SHOW FIELDS before running the search question on the model when the searchable columns are set?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I wanted to use this package so that I can use the benefit of
Laravel Scout
with MySql FULLTEXT. Instead of using raw full text query I used this package so that in future I can easily change the driver and if needed can use more efficient Search driver likeelasticsearch
,TNTSearch
oralgolia
.I found many issue while installing and implementing it. But in the end I was able to install it successfully. For someone who may need this-
First,
DamianTW\MySQLScout\Providers\MySQLScoutServiceProvider::class,
did not work for me it was showing error on running command. So I changes it toYab\MySQLScout\Providers\MySQLScoutServiceProvider::class,
The command
php artisan scout:mysql-index App\\Post
didn't work for me. I changed it tophp artisan scout:mysql-index App\Post
. May be I am using windows ?Now to allow only few selected table columns you should override
toSearchableArray()
method in your model before running above command.Make sure your column is of type
text
orvarchar
To name the index name override
searchableAs()
method in your model before running above commandNote if you already have
FULLTEXT
defined in your table then you can match the above value insearchableAs()
andtoSearchableArray()
methods by providing exact same values.Hope this help someone.
Let me know if it can be improved further or I need to make any correction
The text was updated successfully, but these errors were encountered: