Reputation: 173
I have this document
{
"text_foo": "lorem ipsum",
"one":{
"two":{
"three":{
"text_bar": "dolor sit amet"
}
}
}
}
What i'm trying to acomplish: I need dynamic template, that will match any properties starting with "text_" example:
"mappings" : {
"dynamic_templates":[
{
"text":{
"match": "text_*",
"path_match": "*.text_*",
"match_mapping_type": "*",
"mapping":{"type":"text","analyzer":"myCustomAnalyzer"}
}
}
]
}
Can i use "match"
and "path_match"
together? (Like in my example)
Will "path_match":"*.text_*"
match whole path "one.two.three.text_*"
or only `"one.text_*"?
Will "path_match":"*.text_*"
match also root property "text_foo"
?
If only solution is use regular expresions ("match_pattern":"regex"
), will regular expresion match against whole path "one.two.three.text_bar"
or only against "text_bar"
?
Upvotes: 6
Views: 755