Legal character set for field names


I'd like to add some validation on my side for field names before indexing documents into elsaticsearch. However, I cannot find any documentation describing what is an invalid field name. The only thing I found was this old discussion from 2014, describing the following:

There are also some restrictions on type names for mappings:

  • must not start with underscore "_"
  • must not contain comma ","
  • must not contain hash mark "#"
  • usage of point "." is discouraged but possible

Are these still valid?


All these character are allowed in field names. The only two real issues here are dots and using the fields in query string queries. Since dots are used for inner object fields, having dots in the name can cause some issues, especially if you have multiple dots in a row or the field name starts or ends with a dot. If you are using field in the query string queries it is probably the best to just stick with identified-like syntax in order to avoid clashing with query string query syntax.

Thanks for your reply. I suggest adding this to the official documentation to clarify best practices and limitations.

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