elasticsearch - 尝试在 Elasticsearch 中为 py-image-dedup 定义索引
问题描述
我正在尝试让 py-image-dedup 工作(https://github.com/markusressel/py-image-dedup),这需要在 elasticsearch 中构建索引。到目前为止一切顺利,所有用于 py-image-dedup 和 brew install elasticsearch 的 python 代码都已安装并与 elasticsearch 服务器一起在本地主机地址 127.0.0.1:9200 上愉快地工作
所以现在我尝试建立索引。说明说
curl -X PUT "127.0.0.1:9200/images?pretty" -H "Content-Type: application/json" -d "
{
\"mappings\": {
\"image\": {
\"properties\": {
\"path\": {
\"type\": \"keyword\",
\"ignore_above\": 256
}
}
}
}
}
据我所知,这显然在末尾缺少一个 " 并且在任何变体中都不起作用。
我试试
curl -X PUT "127.0.0.1:9200/images?pretty" -H "Content-Type: application/json" -d "{\"mappings\":{\"image\":{\"properties\":{\"path\":{\"type\":\"keyword\",\"ignore_above\":256}}}}} "
这看起来很明智,但得到
{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [image : {properties={path={ignore_above=256, type=keyword}}}]"
}
],
"type" : "mapper_parsing_exception",
"reason" : "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [image : {properties={path={ignore_above=256, type=keyword}}}]",
"caused_by" : {
"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [image : {properties={path={ignore_above=256, type=keyword}}}]"
}
},
"status" : 400
}
并且无法为我的生活看到为什么索引没有正确构建。感谢帮助。
解决方案
您正在尝试使用已被弃用的类型:https ://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html
image
请从您的映射定义中删除该类型。
curl -X PUT "127.0.0.1:9200/images?pretty" -H "Content-Type: application/json" -d "
{
\"mappings\": {
\"properties\": {
\"path\": {
\"type\": \"keyword\",
\"ignore_above\": 256
}
}
}
}
推荐阅读
- java - Java alexa lambda函数在时间/操作上有一些限制吗?
- google-cloud-platform - 无法在谷歌云存储 gui 中打开文件夹
- java - 如何解密存储在 sessionStorage 中的数据
- php - 将任何 json 数据放在带有 $.each 的标签中
- c# - 从 .Net 控制台应用程序调用 AWS lambda
- scala - How to call an InputKey from within a Task in an SBT Plugin
- jquery - jQuery:仅以内联样式更改背景图像上的线性渐变
- c# - 可靠集合应用程序(组装)是特定的吗?
- java - Java:获取 MIME 多部分 BodyPart 的内容
- visual-studio - 为什么 Visual Studio 从 15.7.X -> 15.9.X 升级后无法打开我的项目