Hey there, i am a beginner and want to use a dynamic template
i wanted to test dynamic templates by using the example in the documentation.
PUT my_index
{
"mappings": {
"dynamic_templates": [
{
"longs_as_strings": {
"match_mapping_type": "string",
"match": "long_",
"unmatch": "_text",
"mapping": {
"type": "long"
}
}
}
]
}
}
PUT my_index/_doc/1
{
"name": {
"first": "Alice",
"middle": "Mary",
"last": "White"
}
}
GET my_index/_search
{
"query": { "match_all": {} }
}
This is the result for my query:
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "my_index",
"_type" : "_doc",
"_id" : "1",
"_score" : 1.0,
"_source" : {
"name" : {
"first" : "Alice",
"middle" : "Mary",
"last" : "White"
}
}
}
]
}
}
My question is shouldnt there be a field "full_name" containing the information "Alice" and "White" ??