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

版本: 6.8-7.17

简而言之,当 Elasticsearch 尝试使用特定 ID 从索引中检索文档时,如果文档或索引本身不存在,就会发生此错误。要解决此问题,您可以验证索引和文档是否存在。确保索引、类型和 ID 的拼写正确且区分大小写。如果文档不存在,您可能需要创建它。如果索引不存在,您可能需要先创建索引,然后再向其中添加文档。

日志上下文 #

日志 “Source not found [” + index + “]/[” + type + “]/[” + id + “]” 的类名是 RestGetSourceAction.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

final String id = response.getId();  if (response.isExists() == false) {
 throw new ResourceNotFoundException("Document not found [" + index + "]/[" + type + "]/[" + id + "]");
 } else if (response.isSourceEmpty()) {
 throw new ResourceNotFoundException("Source not found [" + index + "]/[" + type + "]/[" + id + "]");
 }
 }
 }
}