by default a search returns only the top 10 hits. You can set that by something like:
searchSourceBuilder.size(20)
However, notice that if you want all results out of a search, you may want to look at scroll search, which allows you to scroll through a large search result.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.