lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Shackles" <gshack...@gmail.com>
Subject Re: Determining index term count
Date Wed, 07 Jan 2009 20:18:16 GMT
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.reuschling@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-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message