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

适用版本: 7.16-8.9

简而言之,当查询在Elasticsearch中重复超过100次时会出现此错误。这是系统内置的限制,旨在防止过度使用资源。要解决此问题,您可以优化查询以避免重复。如果确实需要重复,请考虑将查询分解为更小的部分或使用不同的方法来检索数据。您也可以增加限制,但应谨慎操作,因为这可能会影响性能。

日志上下文 #

日志 “A query cannot be repeated more than 100 times; found [{}]” 的类名是 LogicalPlanBuilder.java。我们从Elasticsearch源代码中提取了以下内容,供那些需要深入了解上下文的人参考:

    long value = number.longValue();
    if (value < 1) {
        throw new ParsingException(source(numberCtx), "A positive runs value is required; found [{}]", value);
    }
    if (value > 100) {
        throw new ParsingException(source(numberCtx), "A query cannot be repeated more than 100 times; found [{}]", value);
    }

    runs = (int) value;
}

int numberOfQueries = queries.size() + runs;