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

版本: 7.2-7.15

简要来说,当 Elasticsearch 尝试访问一个不存在的索引时会发生此错误。这可能是由于索引名称拼写错误,或者索引可能已被删除。要解决此问题,您可以检查索引名称是否存在拼写错误,确保在执行操作前索引存在,或者在代码中处理 IndexNotFoundException 以提供更友好的错误消息。您还可以考虑为索引使用别名,以防止直接引用特定的索引名称。

日志上下文 #

日志 “Index [” + ((IndexNotFoundException) e).getIndex() + “] was not found; " 的类名是 RollupResponseTranslator.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

    if (item.isFailure()) {
        Exception e = item.getFailure();  // 如果索引在执行后被删除;给用户一个提示,这是一个临时错误
        if (e instanceof IndexNotFoundException) {
            throw new ResourceNotFoundException("Index [" + ((IndexNotFoundException) e).getIndex() + "] was not found; " +
            "likely because it was deleted while the request was in-flight. Rollup does not support " +
            "partial search results; please try the request again."; e);
        }  // 否则直接抛出