Thanks shai and mark for your suggestions.

I initially tried DuplicateFilter and it is not giving me expected results. It 
removes the duplicates at query time and not in the results.

Regards
Ganesh

----- Original Message ----- 
From: "mark harwood" <markharw...@yahoo.co.uk>
To: <java-user@lucene.apache.org>
Sent: Wednesday, September 02, 2009 5:36 PM
Subject: Re: First result in the group


See "DuplicateFilter" in contrib.

http://markmail.org/message/lsvnpu7mwhht3a4p

Cheers
Mark



----- Original Message ----
From: Ganesh <emailg...@yahoo.co.in>
To: java-user@lucene.apache.org
Sent: Wednesday, 2 September, 2009 12:38:35
Subject: Re: First result in the group

I have a field called category and all documents will have belong to some 
category( say some belong to X and some Y etc). The field values may change 
dynamically. I want the search results to be filterted to retrieve one document 
per category. 

This is similar to 'group by' feature in database.

Regards
Ganesh


----- Original Message ----- 
From: "Shai Erera" <ser...@gmail.com>
To: <java-user@lucene.apache.org>
Sent: Wednesday, September 02, 2009 4:33 PM
Subject: Re: First result in the group


> What do you mean by "first result in the group"? What is a group?
> 
> On Wed, Sep 2, 2009 at 1:36 PM, Ganesh <emailg...@yahoo.co.in> wrote:
> 
>> Hello all,
>>
>> I want to retrieve the first result in the group. How to acheive this?
>> Currently i am parsing all the results, using a hash and avoiding duplicate
>> entries.
>>
>> Is there any better way?
>>
>> Regards
>> Ganesh
>> Send instant messages to your online friends http://in.messenger.yahoo.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
>> For additional commands, e-mail: java-user-h...@lucene.apache.org
>>
>>
>
Send instant messages to your online friends http://in.messenger.yahoo.com

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

Send instant messages to your online friends http://in.messenger.yahoo.com

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