Depending on the number of documents in the result set, pagination will help. We were in process of updating docs with some examples to show use of offset and size - @ibsoln ?
In meantime, you should be able to map the swift examples in this blog to java.