Skip to content
Advertisement

Unable to search with laravel-scout-tntsearch-driver

I just installed this package (laravel-scout-tntsearch-driver) and when using the search() method, I am getting the following error: PDOException with message 'SQLSTATE[HY000] [2002] Connection refused'

Running the command docker exec -it desk_php php artisan scout:import App\Models\TicketMessage result in:

JavaScript

After, I try to run the search in a tinker session and if fails with the Connection refused message.

JavaScript

Here is my scout config file:

JavaScript

Relevant .env settings

JavaScript

Any idea what I could be missing?

EDIT

Here is more details about what I have done.

I have installed the required SqLite extension and enabled it. I have added both Scout and Tnt to the providers array in the proper order. (Scout first)

After I run the import command, I noticed there is no index files generated in storage even if command show a success message.

Advertisement

Answer

From your comment I understand you have yet to configure Laravel to use SQLite by changing the default database setup.

In your config/database.php,

JavaScript

Then, in your .env file you must change the DB_CONNECTION to DB_CONNECTION=sqlite.

In the end, to create the file,

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement