我正在尝试定义一个" null_value"对于"文本"领域(第5.1.1节)。像这样:
getActivity().getSupportActionBar();
这会导致错误:
PUT students
{
"mappings": {
"student": {
"properties": {
"first_name": {
"type": "text",
"null_value": "No First Name"
}
}
}
}
}
但是如果" 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
}
,成功。看documentation,它并没有说明" null_value"仅适用于"关键字"键入的字段。我在这里错过了什么吗?
答案 0 :(得分:2)
null_value
数据类型中不允许 text
。查看表,了解text
数据类型的允许参数。 https://www.elastic.co/guide/en/elasticsearch/reference/5.1/text.html#text-params