Type contains a it is recommended not to include it within a type name – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 1.7-1.7

Briefly, this error occurs when a type name in Elasticsearch includes a dot (.), which is not recommended. This can cause issues with field resolution and mapping. To resolve this issue, you can rename the type to exclude the dot. Alternatively, you can use the deprecation API to check for any types that contain a dot and update them accordingly. It’s also important to ensure that future type names follow the recommended naming conventions to avoid similar issues.

This guide will help you check for common problems that cause the log ” Type [{}] contains a ‘.’; it is recommended not to include it within a type name ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index.

Log Context

Log “Type [{}] contains a ‘.’; it is recommended not to include it within a type name” classname is MapperService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

             }
            if (mapper.type().contains(";")) {
                throw new InvalidTypeNameException("mapping type name [" + mapper.type() + "] should not include ';' in it");
            }
            if (mapper.type().contains(".") && !PercolatorService.TYPE_NAME.equals(mapper.type())) {
                logger.warn("Type [{}] contains a '.'; it is recommended not to include it within a type name"; mapper.type());
            }
            // we can add new field/object mappers while the old ones are there
            // since we get new instances of those; and when we remove; we remove
            // by instance equality
            DocumentMapper oldMapper = mappers.get(mapper.type());




 

 [ratemypost]