简体   繁体   English

如何为导轨应用增加 Elasticsearch 中的索引最大结果 window?

[英]how to increase index max result window in Elasticsearch for a rails application?

elasticsearch return this error when trying to access more than 10,000 records in my rails application elasticsearch 在我的 rails 应用程序中尝试访问超过 10,000 条记录时返回此错误

[500] {"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 [12270].

based on my search I know that there are some solutions根据我的搜索,我知道有一些解决方案

  1. increase index max result window增加索引最大结果 window
  2. use search_after使用 search_after

and I couldn't find a tutorial that would properly set any of them on a rails application, so can you help me doing this?, knowing that I'm using will_paginate gem for pagination, and I want to know if I change it to pagy gem, would it solve the problem, or this error doesn't have a thing to do with the pagination?而且我找不到可以在 Rails 应用程序上正确设置它们的教程,所以你能帮我这样做吗?知道我正在使用 will_paginate gem 进行分页,我想知道我是否将其更改为pagy gem,它会解决问题,还是这个错误与分页无关?

This is an index setting.这是一个索引设置。 Update it by executing Curl as shown below通过执行 Curl 来更新它,如下所示

curl -XPUT " http://localhost:9200/my_index/_settings " -d '{ "index": { "max_result_window": 1000000 } }' curl -XPUT " http://localhost:9200/my_index/_settings " -d '{ "index": { "max_result_window": 1000000 } }'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM