【发布时间】:2017-12-18 17:15:29
【问题描述】:
我正在使用 elasticsearch-rails gem。
当用户在我的分页中单击更高页码的链接时,我收到以下错误。这是错误:
Elasticsearch::Transport::Transport::Errors::InternalServerError ([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 [48700]. 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."}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"products","node":"fNcaDjwzRRGu2fq0KjTWUQ","reason":{"type":"query_phase_execution_exception","reason":"Result window is too large, from + size must be less than or equal to: [10000] but was [48700]. 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."}}]},"status":500}):
我在哪里设置 index.max_result_window 或者这甚至是解决此问题的正确方法?
【问题讨论】:
-
@ThomasEdwards 我使用的是 elasticsearch-rails gem,而不是 elasticsearch rest api。
-
哦,试试这篇文章 medium.com/@thecolorfulcrayon/… 建议在 app/config/initializers 中创建一个 elasticsearch.rb 并在那里设置配置
标签: ruby-on-rails elasticsearch elasticsearch-rails