How to return all the results in search:search API?

我们两清 提交于 2019-12-25 16:54:58

问题


I am using search:search API and came across a scenario in which I want all the docs returned.

I know it will impact the performance but I can bear this as I know there won't be more than 30-50 docs.

I can set the max threshold value which is 50, but just want to know is there way to return all the results.

If in future the count increases I don't need to change the threshold value.


回答1:


You can specify a large pageLength, something like 999 or even bigger.

I'd go for something smaller though, and put in logic that checks whether total count exceeds pageLength, and print a notification if that occurs..

HTH!



来源:https://stackoverflow.com/questions/43226469/how-to-return-all-the-results-in-searchsearch-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!