没有不值得去解决的问题,也没有不值得去学习的技术!

Error When Running sudowww ‘php artisan es:migrate’: Custom Analyzer [ik_smart_synonym] Fails to Find Tokenizer [ik_smart]

When running sudowww 'php artisan es:migrate', an error occurred: Custom Analyzer [ik_smart_synonym] failed to find tokenizer under name [ik_smart]

1. When running sudowww ‘php artisan es:migrate’, an error occurred: Custom Analyzer [ik_smart_synonym] failed to find tokenizer under name [ik_smart]. See Figure 1.

When running sudowww 'php artisan es:migrate', an error occurred: Custom Analyzer [ik_smart_synonym] failed to find tokenizer under name [ik_smart]
Figure 1
Plaintext
root@iZ2ze4fjghbbj74d4kfnf0Z:/var/www/laravel-shop# sudowww 'php artisan es:migrate'
Processing index products
Index does not exist, preparing to create

   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: After installing Elasticsearch by running the command ./20.04/install_elasticsearch.sh 7, the corresponding version of the IK tokenizer plugin was not installed. The operation succeeded. See Figure 2.

Reference: After installing Elasticsearch by running the command ./20.04/install_elasticsearch.sh 7, the corresponding version of the IK tokenizer plugin was not installed. The operation succeeded
Figure 2
Plaintext
root@iZ2zeh119jtszpxb8sf8pvZ:/var/www/laravel-shop# sudowww 'php artisan es:migrate'
Processing index products
Index does not exist, preparing to create
Created successfully, preparing to initialize data
Operation succeeded

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系