如何在search:search API中返回所有结果? [英] How to return all the results in search:search API?

查看:102
本文介绍了如何在search:search API中返回所有结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用search:search API,并且遇到了我希望返回所有文档的情况.

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

我知道这会影响性能,但是我可以忍受,因为我知道不会超过30-50个文档.

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

我可以将最大阈值值设置为 50 ,但只是想知道有没有办法返回所有结果.

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.

推荐答案

您可以指定大的pageLength,例如999或更大的值.

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

我会选择较小的东西,并放入检查总数是否超过pageLength的逻辑,并在发生这种情况时打印通知.

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!

这篇关于如何在search:search API中返回所有结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆