报错原因
我使用的Elasticsearch是7.7.0版本,按照学习文档创建字段时,使用了{"type":"string","index":"not_analyzed"}

原因分析
检查拼写无误之后,我决定去查Elasticsearch新版本特性,因为之前也踩过head插件的安装方法的坑,就是因为版本问题。
果不其然,Elasticsearch从5.X就引入了text和keyword,其中keyword适用于不分词字段,搜索时只能完全匹配,这时string还保留着。
到了6.X就彻底移除string了。
另外,"index"的值只能是boolean变量了。

解决方法

{"type":"text","index":false}

Elasticsearch:No handler for type [string] declared on field[XXX]的解决办法

 

 

参考文档
https://segmentfault.com/a/1190000008897731
https://www.cnblogs.com/zlslch/p/6619089.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.2/breaking-changes-6.0.html

相关文章:

  • 2022-01-15
  • 2021-04-02
  • 2021-08-26
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-07-21
相关资源
相似解决方案