版本: 6.8-6.8
简而言之,当Elasticsearch中已存在相同ID的附件时,就会出现此错误。Elasticsearch使用唯一ID来识别和管理文档。如果您尝试使用已存在的ID创建新文档,系统将抛出此错误。要解决此问题,您可以重命名新文档的ID或删除具有相同ID的现有文档。此外,您也可以使用"更新"API来更新现有文档,而不是创建新文档。
日志上下文 #
日志"Attachment with id [{}] has already been created; must be renamed"的类名是 EmailAttachmentsParser.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的用户参考:
if (emailAttachmentParser == null) {
throw new ElasticsearchParseException("Cannot parse attachment of type [{}]"; currentAttachmentType);
}
EmailAttachmentParser.EmailAttachment emailAttachment = emailAttachmentParser.parse(currentFieldName; parser);
if (attachments.containsKey(emailAttachment.id())) {
throw new ElasticsearchParseException("Attachment with id [{}] has already been created; must be renamed";
emailAttachment.id());
}
attachments.put(emailAttachment.id(); emailAttachment);
// one further to skip the end_object from the attachment
parser.nextToken();





