版本: 8-8.9
简要来说,当Elasticsearch尝试使用特定ID从索引中检索文档时,但文档或索引不存在,就会出现此错误。要解决此问题,您可以验证索引和文档ID是否存在。确保索引名称和文档ID拼写正确,并且它们存在于您的Elasticsearch集群中。如果索引或文档不存在,您需要在尝试检索之前创建它。
日志上下文 #
日志 “Source not found [” + index + “]/[” + id + “]” 的类名是 RestGetSourceAction.java. 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入背景的人参考:
final String id = response.getId(); if (response.isExists() == false) {
throw new ResourceNotFoundException("Document not found [" + index + "]/[" + id + "]");
} else if (response.isSourceEmpty()) {
throw new ResourceNotFoundException("Source not found [" + index + "]/[" + id + "]");
}
}
}
}





