gpt4 book ai didi

elasticsearch - "null_value"不允许用于 "text"字段?

转载 作者:行者123 更新时间:2023-11-29 02:56:05 24 4
gpt4 key购买 nike

我正在尝试为“文本”字段定义“null_value”(版本 5.1.1)。像这样:

PUT students
{
"mappings": {
"student": {
"properties": {
"first_name": {
"type": "text",
"null_value": "No First Name"
}
}
}
}
}

这会导致错误:

{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [first_name] has unsupported parameters: [null_value : No First Name]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [student]: Mapping definition for [first_name] has unsupported parameters: [null_value : No First Name]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [first_name] has unsupported parameters: [null_value : No First Name]"
}
},
"status": 400
}

但是如果 "first_name"被标记为 "type": "keyword",它就会成功。看着 documentation ,它没有说明“null_value”仅适用于“关键字”类型的字段。我在这里遗漏了什么吗?

最佳答案

null_value 不允许出现在 text 数据类型中。查看表格以了解 text 数据类型的允许参数。 https://www.elastic.co/guide/en/elasticsearch/reference/5.1/text.html#text-params

关于elasticsearch - "null_value"不允许用于 "text"字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41862255/

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