版本: 6.8-7.4
简而言之,当Elasticsearch尝试访问一个不存在的索引时,就会发生此错误。这可能是由于索引名称拼写错误,或者索引可能已被删除。要解决此问题,你可以检查索引名称是否有错误,或者如果索引已被删除则重新创建它。此外,你可以在尝试从索引检索数据之前使用"exists" API检查索引是否存在。这可以从一开始就防止错误的发生。
日志上下文 #
日志"] cannot retrieve data because index " + ((IndexNotFoundException)e).getIndex() + " does not exist"的类名是 DataExtractorFactory.java。 我们从Elasticsearch源代码中提取了以下内容,供那些需要深入了解上下文的人参考:
}
};
e -> {
if (e instanceof IndexNotFoundException) {
listener.onFailure(new ResourceNotFoundException("datafeed [" + datafeed.getId()
+ "] cannot retrieve data because index " + ((IndexNotFoundException)e).getIndex() + " does not exist"));
} else {
listener.onFailure(e);
}
}
);





