title: Get most frequent words from Lucene 4.0 index
body: <p>I'm quite new to Lucene. I have a Lucene 4.0 index and I would like to compute the nth most frequent words to create a stopword list. I found posts handling this in previous versions of Lucene such as <a href="https://stackoverflow.com/questions/2821903/get-highest-frequency-terms-from-lucene-index">Get highest frequency terms from Lucene index</a> however it seems reader.terms() has been deprecated in 4.0. </p>
  
  <p>How could I achieve this using Lucene 4.0?</p>
  
  <p>Thanks!</p>