具体报错信息如下:
{
"error": {
"reason": "Error occurred in Elasticsearch engine: all shards failed",
"details": """Shard[0]: [2022/N0zTB2l7SiS4W1lvCNAsBg] QueryShardException[failed to create query: maxClauseCount is set to 1024]; nested: TooManyClauses[maxClauseCount is set to 1024];
For more details, please send request for Json format to see the raw response from elasticsearch engine.""",
"type": "SearchPhaseExecutionException"
},
"status": 400
}
原因:查询请求内容过长报错;
解决:
1)编辑ES的配置文件Elasticsearch.yml,添加:indices.query.bool.max_clause_count: 10240;
注:yml 语法,:冒号后面有空格。
2)重启ES生效:./bin/elasticsearch -d;
这篇博客讨论了在使用Elasticsearch时遇到的'Error occurred in Elasticsearch engine: all shards failed'问题,原因是查询请求内容过长导致的'QueryShardException'。解决方法是在Elasticsearch.yml配置文件中增加indices.query.bool.max_clause_count到10240,并重启ES服务。此问题涉及到搜索引擎优化和大数据检索技术。

被折叠的 条评论
为什么被折叠?



