Execute sudowwwphp artisan es:migrate, error: CUSTOM Analyzer[ik_smart_synonym]Failed to find tokenizer under name[ik_smart]
1. Execute sudowWWphp artisan es:migrate, error: CUSTOM Analyzer[ik_smart_synonym]Failed to find tokenizer under name[ik_smart]. as shown in Figure 1
root@iZ2ze4fjghbbj74d4kfnf0Z:/var/www/laravel-shop# sudowww 'php artisan es:migrate'
正在处理索引 products
索引不存在,准备创建
Elasticsearch\Common\Exceptions\BadRequest400Exception
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Custom Analyzer [ik_smart_synonym] failed to find tokenizer under name [ik_smart]"}],"type":"illegal_argument_exception","reason":"Custom Analyzer [ik_smart_synonym] failed to find tokenizer under name [ik_smart]"},"status":400}
at vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:693
689▕ $exception = new ScriptLangNotSupportedException($responseBody. $statusCode);
690▕ } elseif ($statusCode === 408) {
691▕ $exception = new RequestTimeout408Exception($responseBody, $statusCode);
692▕ } else {
➜ 693▕ $exception = new BadRequest400Exception($responseBody, $statusCode);
694▕ }
695▕
696▕ $this->logRequestFail($request, $response, $exception);
697▕
+9 vendor frames
10 app/Console/Commands/Elasticsearch/Migrate.php:64
Elasticsearch\Namespaces\IndicesNamespace::create()
11 app/Console/Commands/Elasticsearch/Migrate.php:30
App\Console\Commands\Elasticsearch\Migrate::createIndex()
root@iZ2ze4fjghbbj74d4kfnf0Z:/var/www/laravel-shop#
2. Reference: Execute the command: ./20.04/install_elasticsearch.sh 7 After installing Elasticsearch, the corresponding version of the IK word segmentation plugin is not installed. The operation was successful. as shown in Figure 2
root@iZ2zeh119jtszpxb8sf8pvZ:/var/www/laravel-shop# sudowww 'php artisan es:migrate'
正在处理索引 products
索引不存在,准备创建
创建成功,准备初始化数据
操作成功
![执行 sudowww 'php artisan es:migrate' 时,报错:Custom Analyzer [ik_smart_synonym] failed to find tokenizer under name [ik_smart]](https://www.shuijingwanwq.com/wp-content/uploads/2022/09/1-13.png)
