I am trying to search my data and expect to get all data,but I can't get more than 10000 result,so I try to use trackTotalHits ,can someone tell me how to use it?
TrackTotalHits will just give you the exact total number of hits. It's not going to help you to extract all the hits.
But to answer your question, use:
.trackTotalHits(tth -> tth.enabled(true))
To extract all data, you can use:
the size and from parameters to display by default up to 10000 records to your users. If you want to change this limit, you can change index.max_result_window setting but be aware of the consequences (ie memory).
Thanks for your answer!
But I still have some questions
1.I have tried to set index.max_result_window before,but it seems like if i have some new write in data,it won't have this setting?
2.For "search after" and "Scroll API",is there any document about how to use in Java API client?
because all I can get is how to use in elasticsearch but not in Java
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.