Hi,
I have an index that contains fields I'd like to set default dynamic
mappings for as well as a few customized mappings and have a couple
questions:
First, Is this the proper way to create the index?
$ curl -X POST "http://localhost:9200/users_test" -d '
{ "user": {
"dynamic_templates":[{
"long": {
"match_mapping_type":"long",
"match":"*",
"mapping":{ "omit_term_freq_and_positions":true,
"store":"no",
"type":"long",
"omit_norms":true,
"index":"analyzed",
"include_in_all":false }
}}]},
"mapping": {
"properties":{"birthdate":
{"null_value":-62167392000,"type":"long"}
}
}
}'
{"ok":true,"acknowledged":true}
I would expect to see the birthdate mapping show up when doing a get
on the _mapping. but it doesn't:
$ curl -X GET "http://localhost:9200/users_test/_mapping?pretty=true"
{
"users_test" : {
}
Instead it shows up in settings:
$ curl -X GET "http://localhost:9200/users_test/_settings?pretty=true"
{
"users_test" : {
"settings" : {
"index.mapping.properties.birthdate.null_value" :
"-62167392000",
"index.user.dynamic_templates.0.long.mapping.store" : "no",
"index.user.dynamic_templates.0.long.match_mapping_type" :
"long",
"index.user.dynamic_templates.0.long.mapping.include_in_all" :
"false",
"index.user.dynamic_templates.0.long.match" : "*",
"index.user.dynamic_templates.
0.long.mapping.omit_term_freq_and_positions" : "true",
"index.user.dynamic_templates.0.long.mapping.index" :
"analyzed",
"index.mapping.properties.birthdate.type" : "long",
"index.user.dynamic_templates.0.long.mapping.omit_norms" :
"true",
"index.user.dynamic_templates.0.long.mapping.type" : "long",
"index.number_of_shards" : "5",
"index.number_of_replicas" : "1"
}
}
}
Also, will the default "long" template values apply to birthday (ie.
birthday will have a null value set as well as omit_norms: true)?
Here is a gist if it's easier:
Thanks,
Dave