gpt4 book ai didi

elasticsearch - ES索引的最大字段数是多少

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

您知道 flex 索引的最大字段数吗?
就我而言,我有200多种流利的配置

format csv
keys Time,ID,Name,ip,val_1,val_2........,...,.,.,.,.,.,.,.,.,.,.,val_200

但在 flex 指数中,我只能看到字段( 45 )。字段数是否有限制?
还使用动态映射。
"mappings" : {
"_default_" : {
"_all" : {"enabled" : true, "omit_norms" : true},
"dynamic_templates" : [ {
"ID" : {
"match" : "ID",
"mapping" : {
"type" : "string", "index" : "not_analyzed"
}
}
},
{
"Name" : {
"match" : "Name",
"mapping" : {
"type" : "string", "index" : "not_analyzed"
}
}
},
{
"ip" : {
"match" : "ip",
"mapping" : {
"type" : "ip", "index" : "not_analyzed"
}
}
},
{
"string_fields" : {
"match" : "*",
"mapping" : {
"type" : "float", "index" : "not_analyzed"
}
}
}],
"properties" : {
"@timestamp" : { "type" : "date" }
}
}
}

}
}
}

最佳答案

由于string_fields动态映射部分,您的某些值可能会被拒绝。它试图映射所有未以float列出的字段,因此任何非数字的字段都会被拒绝。此映射可能更适合

{
"_default_": {
"_all": {
"enabled": true,
"omit_norms": true
},
"properties": {
"ID": {
"type": "string",
"index": "not_analyzed"
},
"Name": {
"type": "string",
"index": "not_analyzed"
},
"ip": {
"type": "string",
"index": "not_analyzed"
},
"@timestamp": {
"type": "date"
}
},
"dynamic_templates": [{
"other_string": {
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "not_analyzed"
}
}
}]
}
}

区别在于,您将静态匹配的字段移回属性,并且将动态模板更改为仅匹配看似字符串的字段,然后应用 "index": "not_analyzed"修饰符。您的原始映射尝试将其用于浮点类型,但是 float值始终存储而不进行分析。

关于elasticsearch - ES索引的最大字段数是多少,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39280207/

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