版本: 7.7-8.9
简而言之,当 Elasticsearch 无法定位到由 {} 表示的特定对象或资源时,会出现此错误。这可能是由于缺少索引、文档或节点造成的。要解决此问题,首先应验证资源在 Elasticsearch 集群中是否存在。如果不存在,则创建它。如果应该存在,请检查请求中是否存在拼写或大小写错误。此外,确保资源可访问,且不受任何安全设置的限制。
日志上下文 #
日志"{} not found"的类名是 HttpClient.java。 我们从 Elasticsearch 源代码中提取了以下内容,供寻求深入背景的人员参考:
URL next = new URL(base; location); // Deal with relative URLs
url = next.toExternalForm();
conn = createConnection(url);
break;
case HTTP_NOT_FOUND:
throw new ResourceNotFoundException("{} not found"; urlToGet);
default:
int responseCode = conn.getResponseCode();
throw new ElasticsearchStatusException("error during downloading {}"; RestStatus.fromCode(responseCode); urlToGet);
}
}





