-
Notifications
You must be signed in to change notification settings - Fork 25.2k
dynamic templates are parsed OK but fail during index creation #5199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@faxm0dem the dynamic template should be an array of objects this is what you got: {
"dynamic_templates": [
{
"number_fields": {
"mapping": {
"type": "float"
},
"match_pattern": "regex",
"match": "^(duration|.*_num|.*_dur)$",
"match_mapping_type": "string"
},
"integer_fields": {
"mapping": {
"type": "integer"
},
"match_pattern": "regex",
"match": "^(integer|.*_int|.*_len|port|pid|uid|gid|PID|UID|GID|TID|PRI|.*_NUM)$",
"match_mapping_type": "string"
},
"string_fields": {
"mapping": {
"type": "multi_field",
"fields": {
"raw": {
"index": "not_analyzed",
"ignore_above": 256,
"type": "string"
},
"{name}": {
"index": "analyzed",
"omit_norms": true,
"type": "string"
}
}
},
"match_mapping_type": "string",
"match": "*"
}
}
]
} and this is the correct one: {
"dynamic_templates": [
{
"number_fields": {
"mapping": {
"type": "float"
},
"match_pattern": "regex",
"match": "^(duration|.*_num|.*_dur)$",
"match_mapping_type": "string"
}
},
{
"integer_fields": {
"mapping": {
"type": "integer"
},
"match_pattern": "regex",
"match": "^(integer|.*_int|.*_len|port|pid|uid|gid|PID|UID|GID|TID|PRI|.*_NUM)$",
"match_mapping_type": "string"
}
},
{
"string_fields": {
"mapping": {
"type": "multi_field",
"fields": {
"raw": {
"index": "not_analyzed",
"ignore_above": 256,
"type": "string"
},
"{name}": {
"index": "analyzed",
"omit_norms": true,
"type": "string"
}
}
},
"match_mapping_type": "string",
"match": "*"
}
}
]
} |
Thanks, I'll try that. |
Closing in favour of #8802 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When applying dynamic templates, the following config gets applied OK, but triggers the following error message when ES tries to create the index:
When Only one key exists, e.g.
"string_fields"
, then all is goodThe text was updated successfully, but these errors were encountered: