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

版本: 6.8-6.8

简而言之,当Elasticsearch中的rescore窗口大小设置过高时,就会发生此错误。rescore窗口是Elasticsearch将"重新评分"以获得更准确结果的顶部文档数量。如果窗口大小太大,可能会消耗过多内存并降低搜索性能。要解决此问题,您可以将rescore窗口大小减少到一个更可控的数值。或者,您可以增加Elasticsearch节点的堆大小,但应谨慎操作以避免内存溢出错误。

日志上下文 #

日志"Rescore window [" + rescoreContext.getWindowSize() + “] is too large. “的类名是 DefaultSearchContext.java。 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人使用:

throw new QueryPhaseExecutionException(this; "Cannot use [sort] option in conjunction with [rescore].");
}
int maxWindow = indexService.getIndexSettings().getMaxRescoreWindow();
for (RescoreContext rescoreContext: rescore) {
if (rescoreContext.getWindowSize() > maxWindow) {
throw new QueryPhaseExecutionException(this; "Rescore window [" + rescoreContext.getWindowSize() + "] is too large. "
+ "It must be less than [" + maxWindow + "]. This prevents allocating massive heaps for storing the results "
+ "to be rescored. This limit can be set by changing the [" + IndexSettings.MAX_RESCORE_WINDOW_SETTING.getKey()
+ "] index level setting.");  }