gpt4 book ai didi

elasticsearch - 试图在Elasticsearch中为py-image-dedup定义索引

转载 作者:行者123 更新时间:2023-12-03 01:20:50 25 4
gpt4 key购买 nike

我正在尝试使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
}
}
}
}

关于elasticsearch - 试图在Elasticsearch中为py-image-dedup定义索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60216661/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com