--- title: "索引 - 如何解决此 Elasticsearch 异常" date: 2026-03-06 lastmod: 2026-03-06 description: "当 Elasticsearch 尝试访问不存在的索引时会发生此错误。可能原因包括索引名称拼写错误、索引被删除或尚未创建。本文介绍如何解决此异常。" tags: ["索引", "索引未找到异常", "异常处理", "故障排查"] summary: " 版本: 7.2-7.15 简而言之,当 Elasticsearch 尝试访问一个不存在的索引时,就会发生此错误。这可能是由于索引名称拼写错误,或者索引已被删除或尚未创建。要解决此问题,您可以检查索引名称是否存在拼写错误,确保索引已正确创建,或者如果索引被删除则重新创建索引。此外,请确保您尝试执行的操作适合索引的当前状态。 日志上下文 # 日志"Index [“类名称是 RollupResponseTranslator.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考: if (item.isFailure()) { Exception e = item.getFailure(); // 如果索引在执行后被删除;给用户提示这是一个瞬态错误 if (e instanceof IndexNotFoundException) { throw new ResourceNotFoundException("Index [" + ((IndexNotFoundException) e).getIndex().getName() + "] 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."); } // 否则直接抛出 " --- > **版本:** 7.2-7.15 简而言之,当 Elasticsearch 尝试访问一个不存在的索引时,就会发生此错误。这可能是由于索引名称拼写错误,或者索引已被删除或尚未创建。要解决此问题,您可以检查索引名称是否存在拼写错误,确保索引已正确创建,或者如果索引被删除则重新创建索引。此外,请确保您尝试执行的操作适合索引的当前状态。 日志上下文 ----------- 日志"Index ["类名称是 [RollupResponseTranslator.java。](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/) 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考: ```java if (item.isFailure()) { Exception e = item.getFailure(); // 如果索引在执行后被删除;给用户提示这是一个瞬态错误 if (e instanceof IndexNotFoundException) { throw new ResourceNotFoundException("Index [" + ((IndexNotFoundException) e).getIndex().getName() + "] 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."); } // 否则直接抛出 ```