我正在尝试将所有文档都添加到索引中,我尝试了以下操作-
1)首先获取记录总数,然后设置/ _search?size =参数-无效,因为size参数限制为10000
2)尝试通过多次调用进行分页,并使用了参数'?size = 1000&from = 9000' -直到'from'为
"Result window is too large,from + size must be less than or equal to: [10000] but was [100000]. 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"
那我该如何检索索引中的所有文档?我读了一些建议使用滚动api甚至文档状态的答案-
"While a search request returns a single “page” of results,the scroll API can be used to retrieve large numbers of results (or even all results) from a single search request,in much the same way as you would use a cursor on a traditional database."
但是我找不到任何示例查询来在单个请求中获取所有记录。
索引中总共有388794个文档。 另外请注意,这是一次通话,因此我不必担心性能问题。