【问题标题】:Error on running scout:import command. Internal error: panic运行 scout:import 命令时出错。内部错误:恐慌
【发布时间】:2021-10-13 15:02:06
【问题描述】:

我正在使用 laravel scout 和 meilisearch 驱动程序。

问题是:

当我运行命令php artisan scout:import "App\Models\Article" 时,会显示以下错误: 我正在使用 laravel 8。

MeiliSearch\Exceptions\ApiException 

 Internal error: panic

at vendor/meilisearch/meilisearch-php/src/Http/Client.php:197
    193▕     private function parseResponse(ResponseInterface $response)
    194▕     {
    195▕         if ($response->getStatusCode() >= 300) {
    196▕             $body = json_decode($response->getBody()->getContents(), true) ?? $response->getReasonPhrase();
  ➜ 197▕             throw new ApiException($response, $body);
    198▕         }
    199▕ 
    200▕         return json_decode($response->getBody()->getContents(), true);
    201▕     }

      +26 vendor frames 
  27  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

composer.json的内容是这样的:

"require": {
        "laravel/scout": "^9.2",
        "meilisearch/meilisearch-php": "^0.18.3"

 },

Article模特:

class Article extends Model
{
    use HasFactory, Searchable;

    protected $table = 'article';
    public function searchableAs()
    {
        return 'body';
    }
    public function toSearchableArray(){
        return $this->only(['title' , 'body']);
    }
}

【问题讨论】:

    标签: laravel laravel-scout meilisearch


    【解决方案1】:

    终于找到了解决办法。

    我必须使用这个命令来运行 meilisearch:

    ./meilisearch --db-path ./meilifiles --http-addr '127.0.0.1:7700' --master-key="hS3w2KEJCsLdpdaSZIZg"

    代替这个命令:

    ./meilisearch --master-key="hS3w2KEJCsLdpdaSZIZg"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-12
      • 1970-01-01
      • 2018-10-01
      • 2016-05-15
      • 2014-11-25
      • 2015-11-21
      • 2015-12-18
      相关资源
      最近更新 更多