lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Distinct terms values? (like in Luke)
Date Sun, 10 May 2009 15:35:19 GMT
You can get this list using IndexReader.terms(new Term(fieldname,"")). This
returns an enumeration of all terms starting with the given one (the field
name). Just iterate over the TermEnum util the field name of the iterated
term changes.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Ian Vink [mailto:ianvink@gmail.com]
> Sent: Sunday, May 10, 2009 5:04 PM
> To: java-user@lucene.apache.org
> Subject: Distinct terms values? (like in Luke)
> 
> I have tagged each of my documents with a term "religion" and values like
> "Baha'i, Christian, Jewish, Islam" etc.
> In Luke it shows me that I have a term count of 8 for the term "religion"
> 
> How do I get a list of the 8 distinct values for the term religion from an
> index?
> 
> Ian


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