Here you need to pay attention to two variables: start and rows .
In the first case, it returns only 10 documents, because rows is 10. In the second case, it tries to return documents from 21 to 30 ( start is 20, and rows is 10), but there are only 10 corresponding documents so that it returns zero.
If you want all your documents to be returned, set rows to a high value, such as 1000 or 10000, or the number of documents in your index. If you are not using paging, make sure start set to 0.
source share