Re: Return all distinct values

2006-03-30 Thread Volodymyr Bychkoviak
There is one little note. If index has deletions then counters could have wrong values... mark harwood wrote: This example code gets the unique terms for a field and a total num docs for each... String fieldName="myfield"; valueCounts=new ArrayList(); TermEnum termEnum; termEnum = indexReader.

RE: Return all distinct values

2006-03-30 Thread Paul . Illingworth
far as I know, u can use HitsCollector & BitSet combination to count/get unique results. Regards, Jelda > -Original Message- > From: Java Programmer [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 30, 2006 11:06 AM > To: java-user@lucene.apache.org > Subject: Return al

RE: Return all distinct values

2006-03-30 Thread mark harwood
This example code gets the unique terms for a field and a total num docs for each... String fieldName="myfield"; valueCounts=new ArrayList(); TermEnum termEnum; termEnum = indexReader.terms(new Term(fieldName,"")); Term term = termEnum.term(); while (term!=null) { if (!fieldName.equals(ter

RE: Return all distinct values

2006-03-30 Thread Ramana Jelda
D] > Sent: Thursday, March 30, 2006 11:06 AM > To: java-user@lucene.apache.org > Subject: Return all distinct values > > Hello, > I created small Lucene's application which stores lot of my > users infomation, on of it is zipcode in numeric format eg. > 50501, 63601 - zip

Return all distinct values

2006-03-30 Thread Java Programmer
Hello, I created small Lucene's application which stores lot of my users infomation, on of it is zipcode in numeric format eg. 50501, 63601 - zip codes are stored in Text fields so they are fully searchable what I want now to do is getting all unique zipcodes which was stored so far. Something like