我创建了一个例程,将ES客户端从5.x更新到6.x,最后是7.x。
某些客户端无法以某种方式进行更新。
在6.8中加载现有数据失败。
显然是某些映射导致了这种情况。
但是没有应用模板,并且一切正常,我看不出与其他客户端有任何区别。
我知道ES已经删除了string
类型,现在正在使用text
,但是这种类型的string
是从哪里来的呢?那为什么在其他客户端上不发生呢?最后-我该如何解决?我无法在5.x中将类型从string
更改为text
,也无法在6.x中应用模板,因为它没有启动。
Caused by: org.elasticsearch.index.mapper.MapperParsingException: Failed to parse mapping [datapoint]: No handler for type [string] declared on field [batchId]
更新:这是我当前对batchId的映射
http://localhost:9200/_mapping
"batchId":{"type":"keyword"}
最佳答案
似乎您忘记了在映射中将数据类型从string
更改为text
,这导致了MapperParsingException
,这真的很好,异常(exception)是告诉您probalmatic字段为batchId
,只需将其更改为text
数据类型即可使用。
请引用讨论此string
到text
更改的elastic blog,并提供有关在升级时如何处理它的一些技巧。
关于elasticsearch - 无法从6.x中的5.x打开数据:映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64118846/