lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan McKinley <>
Subject solr getUniqueTermCount() when multiple segments?
Date Tue, 07 Sep 2010 06:34:17 GMT

I'm looking at using the new terms.getUniqueTermCount() to give a
quick count for the LukeRequestHandler rather then needing to walk all
the terms.

When solr index reader has just one segment, it works great.  However
with more segments I get:

java.lang.UnsupportedOperationException: this reader does not
implement getUniqueTermCount()
	at org.apache.lucene.index.Terms.getUniqueTermCount(

Is this expected?  Is there any way around that?

I am getting the terms using:

          Terms terms = MultiFields.getTerms(reader, fieldName);
          long cnt = (terms==null) ? 0 : terms.getUniqueTermCount();


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message