Don't mean to hijack this thread, but I have a related question:

Is there also a way to filter the terms based on another field?

For example, the documents might also contain the field "published date", so I want to get a distinct list of values for the term "religion" in documents published within a range of dates.

Thanks
Jeff

On May 10, 2009, at 11:35 AM, Uwe Schindler wrote:

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: u...@thetaphi.de

-----Original Message-----
From: Ian Vink [mailto:ianv...@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-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



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

Reply via email to