当queue=true时,Laravel Scout w/Meilisearch 和 Redis 队列导入失败

问题描述 投票:0回答:1

当我跑步时

sail php artisan scout:import "App\Models\Persona"

使用queue=false,一切正常,并且我已经确认搜索返回结果。

但是当我打开队列并运行上面的代码时,我会在日志中看到以下内容:

[2024-04-04 12:54:59] local.ERROR: Please install the suggested Meilisearch client: meilisearch/meilisearch-php. {"exception":"[object] (Exception(code: 0): Please install the suggested Meilisearch client: meilisearch/meilisearch-php. at /var/www/html/vendor/laravel/sc>
[stacktrace]
#0 /var/www/html/vendor/laravel/scout/src/EngineManager.php(123): Laravel\\Scout\\EngineManager->ensureMeilisearchClientIsInstalled()
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Manager.php(106): Laravel\\Scout\\EngineManager->createMeilisearchDriver()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Manager.php(80): Illuminate\\Support\\Manager->createDriver()
#3 /var/www/html/vendor/laravel/scout/src/EngineManager.php(30): Illuminate\\Support\\Manager->driver()
#4 /var/www/html/vendor/laravel/scout/src/Searchable.php(329): Laravel\\Scout\\EngineManager->engine()
#5 /var/www/html/vendor/laravel/scout/src/Jobs/MakeSearchable.php(42): App\\Models\\Persona->searchableUsing()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Laravel\\Scout\\Jobs\\MakeSearchable->handle()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): Illuminate\\Bus\\Dispatcher->dispatchNow()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\\Pipeline\\Pipeline->then()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware()
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(102): Illuminate\\Queue\\CallQueuedHandler->call()
#21 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(439): Illuminate\\Queue\\Jobs\\Job->fire()
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(389): Illuminate\\Queue\\Worker->process()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(176): Illuminate\\Queue\\Worker->runJob()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(137): Illuminate\\Queue\\Worker->daemon()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(120): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\Container\\Container->call()
#32 /var/www/html/vendor/symfony/console/Command/Command.php(326): Illuminate\\Console\\Command->execute()
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\Component\\Console\\Command\\Command->run()
#34 /var/www/html/vendor/symfony/console/Application.php(1096): Illuminate\\Console\\Command->run()
#35 /var/www/html/vendor/symfony/console/Application.php(324): Symfony\\Component\\Console\\Application->doRunCommand()
#36 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\\Component\\Console\\Application->doRun()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\\Component\\Console\\Application->run()
#38 /var/www/html/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#39 {main}

输出

sail php artisan queue:work redis

是这些的长链:

2024-04-04 12:55:01 Laravel\Scout\Jobs\MakeSearchable ........................................................................................ RUNNING
  2024-04-04 12:55:01 Laravel\Scout\Jobs\MakeSearchable ................................................................................... 23.39ms FAIL

显然我已经安装了meilisearch-php。 我阅读并遵循了 Laravel 文档中有关 Scout 和队列的说明,但也许我错过了一些东西?

redis laravel-10 laravel-queue laravel-scout meilisearch
1个回答
0
投票

确保您使用的是Meilisearch 1.0版本或更高版本。

© www.soinside.com 2019 - 2024. All rights reserved.