I'm still a bit new to Lucene, but the way I think you can handle it is
using a Boolean query.

//Create a bool Query
BooleanQuery boolQuery = new BooleanQuery();

Loop through each query and add it to the boolQuery

//Addend the boolean queries together Using the And syntax
boolQuery.add(queryX, true, false);

Then do a hits = is.search(boolQuery);


-----Original Message-----
From: Ravi [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 18, 2006 8:20 AM
To: java-user@lucene.apache.org
Subject: :intersection of two hits objects:

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

 

 

 

I would appreciate any help from all 

 

 

Thanks

 

Ravi Kumar Jaladanki

 

 

 

 


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

Reply via email to