📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

简而言之,当Elasticsearch中的映射类型名称包含'#‘字符时,会出现此错误。Elasticsearch不允许在映射类型名称中使用’#‘等某些特殊字符。要解决此问题,你应该重命名映射类型并移除’#‘字符。或者,你可以用允许的字符或字符序列替换’#‘字符。始终确保遵循Elasticsearch设置的命名约定和限制,以避免此类错误。

日志上下文 #

日志"mapping type name [" + type + “] should not include ‘#’ in it"的类名是 MapperService.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考:

throw new InvalidTypeNameException(
    "mapping type name [" + type + "] can't start with '_' unless it is called [" + SINGLE_MAPPING_NAME + "]"
);
}
if (type.contains("#")) {
    throw new InvalidTypeNameException("mapping type name [" + type + "] should not include '#' in it");
}
if (type.contains(";")) {
    throw new InvalidTypeNameException("mapping type name [" + type + "] should not include ';' in it");
}
if (type.charAt(0) == '.') {