Thanks, works like a charm. 

-----Original Message-----
From: Paul Elschot [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 14, 2005 11:05 AM
To: java-user@lucene.apache.org
Subject: Re: Simple Search Question.

On Monday 14 March 2005 19:59, Kyong Kwak wrote:
> 
> I looked and didn't find anything and wanted to know what the best way

> might be for getting a unique list of values in a given field?
> so if I have a field named "category" ( it's a keyword ) and I wanted 
> to get all the unique values for that, how would I go about it?

The normal way is to use IndexReader.terms(Term), passing it a Term
constructed from the field name and an empty string, and stopping on the
returned TermEnum when the field name changes.

Regards,
Paul Elschot



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to