问题
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