yabhq / laravel-scout-mysql-driver

Laravel Scout MySQL Driver
MIT License
522 stars 113 forks source link

LIKE mode not found #78

Closed ibrahimdolas closed 5 years ago

ibrahimdolas commented 5 years ago

During the development everything was fine. But after deployment, I'm getting this error:

'Yab\MySQLScout\Engines\Modes\LIke' not found

First, I got this error on database migrations. Then i commented use Searchable lines on my models and successfully migrated. After migration I've remove the comment and indexed my models. But when I'm trying to search a query, I'm still getting this error.

Here is my scout configuration

'mysql' => [ 'mode' => 'NATURAL_LANGUAGE', 'model_directories' => [app_path()], 'min_search_length' => 1, 'min_fulltext_search_length' => 1, 'min_fulltext_search_fallback' => 'LIKE', 'query_expansion' => false ],

My deadline is in 24 hours. So, any help will be appreciated.

ibrahimdolas commented 5 years ago

I've solved the issue. It was simple. But it caused me almost 48 hours.

'min_fulltext_search_fallback' => 'LIKE'

in the scout.php, there is a strtolower function for the word LIKE, and because of my character set, (UTF-8 Turkish) the 'I' letter causes a confliction. So, I changed this line like the below and the problem has solved.

'min_fulltext_search_fallback' => 'like'