我正在向 elasticsearch 添加一个架构,并在该架构中尝试添加一些先前已作为字符串处理的长字段。我创建了一个新索引并重新处理了数据,但在新索引中这些字段仍然显示为字符串。
来自索引端点的映射的相关部分:
image_features: {
properties: {
brightness: {
type: "string"
},
contrast: {
type: "string"
},
height: {
type: "long"
},
sharpness: {
type: "string"
},
width: {
type: "long"
}
}
}
Run Code Online (Sandbox Code Playgroud)
但返回发回:
image_features: {
width: "400",
height: "400",
sharpness: "good",
contrast: "good",
brightness: "good"
},
Run Code Online (Sandbox Code Playgroud)
我最初创建了一个新索引并使用reindex来迁移数据。我还尝试创建一个新索引并通过批量操作重新加载所有数据。但这些值仍然是剩余的字符串。