I want to create dynamic_template mapping for this document:
{
"COUNT:integer":1,
"one":{
"COUNT:integer":1,
"two":{
"COUNT:integer":1,
"three":{
"COUNT:integer":1,
}
}
}
}
My goal is to create something like:
"mappings" : {
"dynamic_templates":[
{
"integer":{
"match": "*:integer",
"match_mapping_type": "*",
"mapping": {"type":"integer"}
}
}
]
}
My question:
will this mapping match all "COUNT:integer" values, including one.COUNT:integer
, one.two.COUNT:integer
and one.two.three.COUNT:integer
?
(And how to test, witch attributes matches this expression?)
If not, how to change mapping to achieve this goal?
- possible solution 1:
match_pattern
andRegex
. Isregex
testing whole path (one.two.three.COUNT:integer
) or just attribute nameCOUNT:integer
? - possible solution 2:
path_match
. In documentation is not specified, if"path_match":"*.*:integer"
matches onlyone.COUNT:integer
, or if it matches alsoCOUNT:integer
andone.two.COUNT:integer
andone.two.three.COUNT:integer