MapperParsingException trying to define an index template

(Edem Morny) #1

I'm using Elasticsearch 1.2.1, and attempting to define an index template
that should prevent the analysis of certain ID fields in our datamodel,
whiles allowing everything else to be analyzed. I've created a template
json file and put it in the config/templates directory.

Here is my template json file
"carewex_template": {
"template": "*",
"settings": {
"index.number_of_shards": 2
"mappings": {
"default": {
"_all": {
"enabled": false
"type": "{dynamic_type}",
"index": "analyzed",
"fields": {
"id": {"type": "{dynamic_type}", "index":
"productId": {"type": "{dynamic_type}", "index":
"facilityId": {"type": "{dynamic_type}", "index":
"departmentId": {"type": "{dynamic_type}", "index":
"patientId": {"type": "{dynamic_type}", "index":
"secondaryId": {"type": "{dynamic_type}", "index":



However when I try to index, I get the following exception.

Caused by: org.elasticsearch.index.mapper.MapperParsingException: Root type
mapping not empty after parsing! Remaining fields: [index : analyzed] [type
: {dynamic_type}] [fields : {secondaryId={index=not_analyzed,
type={dynamic_type}}, id={index=not_analyzed, type={dynamic_type}},
patientId={index=not_analyzed, type={dynamic_type}},
departmentId={index=not_analyzed, type={dynamic_type}},
facilityId={index=not_analyzed, type={dynamic_type}},
productId={index=not_analyzed, type={dynamic_type}}}]

Any ideas on what do do about this?

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
To view this discussion on the web visit
For more options, visit

(system) #2