ElasticSearch mapping template validation


(Weiwei Wang) #1

I found mapping template is not well validated when put to ES, for example(part of template):

 "reports": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "omit_norms": true,
                      "fields": {
                          "ignore_above": 256,
                          "index": "not_analyzed",
                          "omit_norms": true,
                          "doc_values": true,
                          "type": "string"
                      }
                    }
                  }
                }

this mapping is not correct, as i forgot in the fields mapping should add a field name, but when i put the template to es, no error is reported, but when a index matching this template is created, error is reported and the index will not be created.

This problem happened when I worked with ELK and updated a mapping template, the next day no index is created and lots of logs are lost as the mapping template is not correct.

Hope the future release will add an validation for mapping template.


(system) #2