title: How to get most frequent term from IndexReader using Apache lucene 6.4.0
body: <p>Seems Apache Lucene api is getting changed from every version. How can I get most frequent term from IndexReader of Apache lucene 6.4.0.</p>
  
  <p>I saw <a href="https://stackoverflow.com/questions/2821903/get-highest-frequency-terms-from-lucene-index">Get highest frequency terms from Lucene index</a> which is not useful with Apache Lucene 6.4.0</p>