lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan McKinley" <ryan...@gmail.com>
Subject distinct term values?
Date Wed, 04 Apr 2007 22:24:47 GMT
Is there an efficient way to know how many distinct terms there are
for a given field name?

I know I can walk through a TermEnum and put them into a hash, but it
would be useful to know beforehand if you are going to get 4 distinct
values or 40,000

I don't need to know what the terms are, just how many.

name:A
name:A
name:B

I want a function like:
  getDistinctTermValues( "name" ) -> 2

Thanks
ryan

---------------------------------------------------------------------
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