lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: How to get the number of unique terms in the inverted index
Date Thu, 27 May 2010 19:43:43 GMT
On Thu, May 27, 2010 at 2:32 PM, kannan chandrasekaran
<ckannanck@yahoo.com> wrote:
> I was wondering  if there is a way to retrieve the number of unique terms in the lucene
( version 2.4.0) ... I am aware of the terms() && terms(Term) method that returns
an enumeration (TermEnum) but that involves iterating through the terms and couting them.
 I looking for something similar to numdocs() in the IndexReader class.

No there is not.
In 4.0-dev, with the new "flex" APIs, you can retrieve the number of
unique terms in a single segment (Terms.getUniqueTermCount()), but not
a whole index.

-Yonik
http://www.lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message