I'm not sure offhand how to write the code to do it, but I know when you open an index in Luke, that is one of the numbers it gives you. If you want to just get the number once that would be an easy way to do it. If you want the code for it, Luke is open source so you could see how they do it. (I used Luke as a starting point at one point for seeing how to get a list of high frequency terms).
- Greg On Wed, Jan 7, 2009 at 10:09 AM, Christian Reuschling < christian.reuschl...@gmail.com> wrote: > Is there a fast way to determine the total number of terms inside an index? > > Currently I only found the way to walk through the TermEnumeration, i.e. > > TermEnum termEnum4TermCount = reader.terms(); > int iTermCount = 0; > > while (termEnum4TermCount.next()) > iTermCount++; > > termEnum4TermCount.close(); > > > Thanks for all answers! > > Christian > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >