Elasticsearch 2.1:结果窗口太大(index.max_result_window) [英] Elasticsearch 2.1: Result window is too large (index.max_result_window)

查看:2744
本文介绍了Elasticsearch 2.1:结果窗口太大(index.max_result_window)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们从Elasticsearch 2.1检索信息,并允许用户浏览结果。当用户请求高页数时,我们会收到以下错误消息:

We retrieve information from Elasticsearch 2.1 and allow the user to page thru the results. When the user requests a high page number we get the following error message:


结果窗口太大,从+大小必须小于或等于
到:[10000],但是[10020]。请参阅scroll api以获得更高效的
方式来请求大型数据集。可以通过更改
[index.max_result_window]索引级别参数

Result window is too large, from + size must be less than or equal to: [10000] but was [10020]. 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 parameter

来设置此限制弹性文档表示这是因为内存消耗高,并且使用滚动api:

The elastic docu says that this is because of high memory consumption and to use the scrolling api:


高于每个
搜索可以消耗大量堆内存的值并且每个分片执行搜索。离开这个
值是最安全的,因为它是使用滚动API来进行任何深入的滚动 https://www.elastic.co/guide/en/elasticsearch/reference/2.x/breaking_21_search_changes.html#_from_size_limits

事情是我不想检索大数据集。我只想从结果集中非常高的数据集中检索切片。滚动文件也说:

The thing is that I do not want to retrieve large data sets. I only want to retrieve a slice from the data set which is very high up in the result set. Also the scrolling docu says:


滚动不适用于实时用户请求 https://www.elastic.co/guide/en/elasticsearch/reference/2.2/search-request-scroll.html

这让我有一些问题:

1)内存消耗真的要低一点(如果是这样的话),如果我使用滚动的api向上滚动到结果10020(并忽略10000以下的一切),而不是为结果10000-10020做一个正常的搜索请求?

1) Would the memory consumption really be lower (any if so why) if I use the scrolling api to scroll up to result 10020 (and disregard everything below 10000) instead of doing a "normal" search request for result 10000-10020?

2)似乎滚动API对我来说是一个选择,但是我必须增加index.max_result_window。有没有人有任何经验?

2) It does not seem that the scrolling API is an option for me but that I have to increase "index.max_result_window". Does anyone have any experience with this?

3)有什么其他选项可以解决我的问题吗?

3) Are there any other options to solve my problem?

推荐答案

弹性文档中的以下页面介绍了深层分页:

The following pages in the elastic documentation talk about deep paging:

https://www.elastic.co/guide/en/elasticsearch/guide/current/pagination.html
https://www.elastic.co/guide/en/elasticsearch/guide/current/_fetch_phase。 html


根据您的文档大小,分片数量和您正在使用的
硬件,寻找10,000到50,000个结果(1,000到
5,000页)深层应该是完美可行的。但是,从
值的大小来看,使用庞大的
数量的CPU,内存和带宽,排序过程可能变得非常繁重。因此,我们强烈地要求
提供深层寻呼。

Depending on the size of your documents, the number of shards, and the hardware you are using, paging 10,000 to 50,000 results (1,000 to 5,000 pages) deep should be perfectly doable. But with big-enough from values, the sorting process can become very heavy indeed, using vast amounts of CPU, memory, and bandwidth. For this reason, we strongly advise against deep paging.

这篇关于Elasticsearch 2.1:结果窗口太大(index.max_result_window)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆