Thanks for your help ,

I am able to get the record numbers in BitSet object but how to iterate in
the first hits1 object with the bitset object and retain only those
documents  which contains ids existed in bitset object..


Thanks
Ravi Kumar jaladanki

-----Original Message-----
From: Dave Kor [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 19, 2006 7:01 AM
To: java-user@lucene.apache.org
Subject: Re: :intersection of two hits objects:

On 1/18/06, Ravi <[EMAIL PROTECTED]> wrote:
> Hi
>
> I want to find out the intersection of two hits objects  please help me
>
> Hits hits1 = Searcher.searh(strQuery1);
> Hits hits2 = Searcher.searh(strQuery2);
>
> Now In hits1 contains records numbers 3,4 ,5,6 and
>        Hits2 contains records numbers 3,6,8,9
>
> Now I need a solution which can give the hits object which contains  3,6
> records
>

You can iterate through the Hits objects, flagging the document
numbers in a java.util.BitSet. To compare hits between different
queries, all you have to do is bitset1.and(bitset2).

--
Dave Kor, Research Assistant
Center for Information Mining and Extraction
School of Computing
National University of Singapore.

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