我一直在用Django开发一个使用Postgres和ElasticSearch的web应用程序。它使用弹性搜索,因为数据库存储了大量的数据,并且每小时都在增加。为了快速工作,我使用了django haystack 2.6.0,它允许我很容易地访问弹性搜索。到现在为止,一直都还不错。在
当我在ElasticSearch上进行查询时,问题出现了,结果非常大。我得到的错误是:
TransportError: TransportError(500, u'search_phase_execution_exception', u'Result window is too large, from + size must be less than or equal to: [10000] but was [12602]. 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.')
经过一些研究后,我尝试增加结果窗口的大小,但这在长期内行不通,因为查询集的大小一直在增加。 另外,django haystack似乎没有实现scroll api,因此我无法遵循堆栈跟踪中显示的建议。在
我的问题是:有没有什么方法可以修复这个错误,并使用django haystack获得一个大的查询集,或者以某种方式对结果进行分页? 或者有没有更好的方法不用干草堆?在
提前谢谢!在
目前没有回答
相关问题 更多 >
编程相关推荐