版本: 7.7-7.15
简而言之,当Elasticsearch中的’node.data’设置为’false’时,如果尝试执行’joining’查询,就会出现此错误。此设置意味着节点不会保存任何数据,因此无法执行joining查询。要解决此问题,您可以将’node.data’设置更改为’true',或者将查询移动到’node.data’设置为’true’的节点上。另一个解决方案是重新配置集群,使数据节点可用于执行此类查询。
日志上下文 #
日志"[joining] queries cannot be executed when ‘“的类名是 NestedQueryBuilder.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考:
} @Override
protected Query doToQuery(SearchExecutionContext context) throws IOException {
if (context.allowExpensiveQueries() == false) {
throw new ElasticsearchException("[joining] queries cannot be executed when '" +
ALLOW_EXPENSIVE_QUERIES.getKey() + "' is set to false.");
} ObjectMapper nestedObjectMapper = context.getObjectMapper(path);
if (nestedObjectMapper == null) {





