本人使用的ElasticSearch7.3
官方文档坑得要命
好多demo拿下来根本没法用
每个demo创建完索引(index)再创建文档模板(mapping)的时候都报错
这边网上查到的资料有的说因为ElasticSearch移除了type
需要添加 ‘include_type_name’ => true
经测试,纯属扯淡!!!

通过排查log日志发现,log中报“No handler for type [string] declared on field [profile]”的错误

最后再查阅资料得到真正的错误原因:创建mapping时index的类型必须为布尔型,type中不再使用string类型

es官方demo中还在使用string类型,寡人简直无力吐槽
官方demo地址:https://www.elastic.co/guide/cn/elasticsearch/php/current/_installation_2.html
博主在使用ElasticSearch7.3时遇到官方文档的问题,发现许多示例无法直接运行,尤其在创建索引和文档模板时遇到类型错误。经过排查,发现由于ElasticSearch移除type且不支持string类型,解决方案是将映射(mapping)的type设为布尔值。官方示例中仍使用string类型,导致错误。
4647

被折叠的 条评论
为什么被折叠?



