我正在将ElasticSearch 6.x版本与Spark ES驱动程序配合使用。
在创建索引/类型时,我使用的是dynamic = strict模式。
当我尝试使用rest-client(邮递员)加载包含映射文件中提到的字段以外的其他字段的文档时,出现以下错误:
{
"error": {
"root_cause": [
{
"type": "strict_dynamic_mapping_exception",
"reason": "mapping set to strict, dynamic introduction of [1URBANIZEDAREA] within [tc302_record] is not allowed"
}
],
"type": "strict_dynamic_mapping_exception",
"reason": "mapping set to strict, dynamic introduction of [1URBANIZEDAREA] within [tc302_record] is not allowed"
},
"status": 400
}
但是,当我尝试使用Java Spark ES驱动程序加载同一文档时,该文档正在处理中。但是它仅加载映射文件中提到的那些字段。其他字段将被忽略。行为似乎是将dynamic设置为false。
关于如何解决此问题的任何想法?