MapperParsingException[Failed to parse mapping...]

I keep getting the following exception while creating index using API. This does not happen in all cases.

{"message":"Elasticsearch exception: MapperParsingException[Failed to parse mapping [records]: name cannot be empty string]; nested: IllegalArgumentException[name cannot be empty string]

Its a large index with over 200 fields and is created using API. I am wondering how do I know what exactly is the issue. Could someone throw some light?

Replying on my own thread. It looks like there is a period "." in the fieldName. I tried it manually and found out that adding period at the end of the fieldname works (e.g. "myfield..."), however if there is any character after period (e.g. "myfield.x"), then it fails with the above error.

Interestingly, the error message from ES and API are different, which made it hard to debug. I had to look into ES code. I guess period makes it confusing for ES to differentiate nested and other types.

Is there any official documentation that mentions the list of illegal characters in ES? This post specifies that ".", "#" & "*" are illegal characters.

I'm new here so I can't give you a definitive answer here, but while working on an unrelated mapping issue I did come across the following which may be relevant for you to check into: https://www.elastic.co/guide/en/elasticsearch/reference/2.4/dots-in-names.html

Also this discussion is older but may be worthwhile for you as well: https://github.com/elastic/elasticsearch/issues/15951

That's quite useful. I guess the bottom line is that, we shouldn't use dots. In our case we are using ES version 5.3

1 Like

I think dots can be used, but there are some caveats or some complexities to be aware of, but if they can be avoided then it could make things a lot easier.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.