1
我使用創建在ES動態映射:默認值
{
"template": "infobox*",
"mappings": {
"_default_": {
"dynamic_templates": [
{
"string_fields": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "analyzed",
"analyzer": "my_completion_analyzer",
"fielddata": {
"format": "disabled"
},
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 256
}
}
}
}
}
]
}
}
}
所以,每當I指數具有date
字段(birthYear
)的文檔時,它會自動創建的字段(birthYear
)與date
類型。所以,只要我沒有birthYear
,我會發送一個空字符串''
,然後產生一個異常mapper_parsing_exception, failed to parse [birthYear]
。
有什麼辦法可以處理嗎?我可以分配一個默認值嗎?
是'birthYear'類型的日期? –
是的......是...... – PythonEnthusiast