elasticsearch - ElasticSearch无法返回超过10,000偏移量的数据,不允许进行索引级别更改。无法使用Scroll API

标签 elasticsearch

我正在逐步运行ES查询以获取不同的偏移量和限制。例如100到149,然后150到199,然后200到249 ..依此类推。
当我保持offset + limit大于10,000时,出现以下异常:

{
   "error": {
      "root_cause": [
         {
            "type": "query_phase_execution_exception",
            "reason": "Result window is too large, from + size must be less than or equal to: [10000] but was [10001]. 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."
         }
      ],
      "type": "search_phase_execution_exception",
      "reason": "all shards failed",
      "phase": "query",
      "grouped": true,
      "failed_shards": [
         {
            "shard": 0,
            "index": "xyz",
            "node": "123",
            "reason": {
               "type": "query_phase_execution_exception",
               "reason": "Result window is too large, from + size must be less than or equal to: [10000] but was [10001]. 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."
            }
         }
      ]
   },
   "status": 500
}

我知道我们可以通过增加“max_result_window”来解决此问题。我尝试过,它也有帮助。我将其增加到15,000,然后增加到30,000。但是我不允许更改索引级别。
因此,我将其更改回默认值10,000。

我怎么解决这个问题?该查询被API调用击中。

最佳答案

关于elasticsearch - ElasticSearch无法返回超过10,000偏移量的数据,不允许进行索引级别更改。无法使用Scroll API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58973701/

相关文章:

c# - 如何使用 Nest 从 Elasticsearch 获取仅包含某些字段的类型化 DTO?

python - 如何专门使用 Elasticsearch 索引 "in-memory"?

elasticsearch - 在Elasticsearch中使用两个不同的字段进行搜索查询

mongodb - 如何在 elasticsearch 中为 mongo-connector 生成的索引创建映射

elasticsearch - edge_ngram token 生成器在 Elasticsearch 中的问题

elasticsearch - 无法在Elasticsearch中动态更新指数恢复设置

elasticsearch - Elasticsearch /kibana 从相同索引的 2 个文档中获取数据?

elasticsearch - Elasticsearch 2.1.0

elasticsearch - 如何使用 curl 删除 Elasticsearch 中的 arraylist 值?

python - Elasticsearch 通过搜索返回拼音标记