Elasticsearch exception [type=illegal_argument_exception, reason=Result window is too large, from + size must be less than or equal to: [10000] but was [20720]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting.]
时间: 2024-04-19 11:23:51 浏览: 232
您遇到的错误是 Elasticsearch 的一个异常,类型为 illegal_argument_exception,原因是搜索结果的窗口太大。具体来说,from + size 的值必须小于等于 10000,但实际的值是 20720。要请求大数据集的更高效方式,可以参考 Elasticsearch 的 scroll API。此限制可以通过更改 index.max_result_window 索引级别设置来进行调整。
相关问题
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=no mapping found for field [suggestions]]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=no mapping found for field [suggestions]]];] with root cause
这个错误是由于 Elasticsearch 搜索过程中出现了异常,导致请求处理失败。具体来说,原因是 Elasticsearch 中没有名为 "suggestions" 的映射字段,所以无法执行搜索操作。你需要检查 Elasticsearch 索引中的映射配置是否正确,确保 "suggestions" 字段已经正确定义。如果还是无法解决问题,你可以查看 Elasticsearch 的日志,找到详细的错误信息并进行排查。
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Fielddata is disabled on text fields by default. Set fielddata=true on [category] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Fielddata is disabled on text fields by default. Set fielddata=true on [category] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.]];] with root cause
这个异常信息是关于 Elasticsearch 的,大致意思是:在执行搜索时,所有分片都失败了。原因是在查询中使用了文本字段(text fields)的聚合(aggregation)功能,但是默认情况下,文本字段是禁用了 Fielddata(一个 ElasticSearch 中的内存结构,用于支持聚合、排序等操作)的。要解决这个问题,可以在查询中设置 `fielddata=true`,或者使用关键字字段(keyword field)代替文本字段。
阅读全文