Registering default mappings and dynamic templates via Java Api

Hi there,

I am trying to setup configuration on an embedded elasticsearch node that
consists of dynamic templates and mappings for 'defaullt'.
I am using the following template that defines several dynamic templates
and a mapping to enable "_timestamp" on each type.

{
                "_default_" : {
                    "dynamic_templates" : [
                         {
                             "string_template" : {
                                 "match_mapping_type" : "string",
                                 "path_match" : "*.fulltext",
                                 "mapping" : {
                                      "type" : "multi_field",
                                     "fields" : {
                                         "{name}" : {"type": "string", 

"index" : "analyzed"
},
"untouched" : {
"type": "string", "index"
: "not_analyzed""
"}"
}"
}"
}"
}"
,
{"
"string_nonanalyzed_template" : {
"match_mapping_type" : "string",
"path_match" : "",
"mapping" : {
"index" : "not_analyzed",
"type" : "string"
, "include_in_all" : false
}
}
}
,
{
"long_template" : {
"match_mapping_type" : "long",
"match" : "
",
"mapping" : {
"index" : "not_analyzed",
"type" : "long"
, "include_in_all" : false
}
}
}
],
"_timestamp" : {
""enabled" : true,
""store": true
}
}
}

I register it at index creation using the following Java Api call:

client.admin().indices().prepareCreate(getMandatoryTBox().getId()).addMapping("default",
IndexServiceImpl.DYN_TEMPLATE).execute().actionGet();

The dynamic templates are applied correctly to all types in the system.
However the _timestamp field does not show up when I look at the index in
elasticsearch-head.
What am I missing or doing wrong?
Thanks a lot in advance.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Are all these extra quotes part of your template or it's just badly
formatted email?

                                         "untouched" : {
                                             "type": "string", "index" 

: "not_analyzed""
"}"
}"
}"
}"
}"

If it's former, could you post clean mapping?

On Tuesday, January 29, 2013 2:27:23 AM UTC-5, eg wrote:

Hi there,

I am trying to setup configuration on an embedded elasticsearch node that
consists of dynamic templates and mappings for 'defaullt'.
I am using the following template that defines several dynamic templates
and a mapping to enable "_timestamp" on each type.

{
                "_default_" : {
                    "dynamic_templates" : [
                         {
                             "string_template" : {
                                 "match_mapping_type" : "string",
                                 "path_match" : "*.fulltext",
                                 "mapping" : {
                                      "type" : "multi_field",
                                     "fields" : {
                                         "{name}" : {"type": "string", 

"index" : "analyzed"
},
"untouched" : {
"type": "string", "index"
: "not_analyzed""
"}"
}"
}"
}"
}"
,
{"
"string_nonanalyzed_template" : {
"match_mapping_type" : "string",
"path_match" : "",
"mapping" : {
"index" : "not_analyzed",
"type" : "string"
, "include_in_all" : false
}
}
}
,
{
"long_template" : {
"match_mapping_type" : "long",
"match" : "
",
"mapping" : {
"index" : "not_analyzed",
"type" : "long"
, "include_in_all" : false
}
}
}
],
"_timestamp" : {
""enabled" : true,
""store": true
}
}
}

I register it at index creation using the following Java Api call:

client.admin().indices().prepareCreate(getMandatoryTBox().getId()).addMapping("default",
IndexServiceImpl.DYN_TEMPLATE).execute().actionGet();

The dynamic templates are applied correctly to all types in the system.
However the _timestamp field does not show up when I look at the index in
elasticsearch-head.
What am I missing or doing wrong?
Thanks a lot in advance.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.