lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Natarajan.T" <nataraj...@crimsonlogic.co.in>
Subject RE: Filter !!!
Date Tue, 07 Dec 2004 06:25:11 GMT
Thanks for your response..

 

-----Original Message-----
From: hossman@hal.rescomp.berkeley.edu
[mailto:hossman@hal.rescomp.berkeley.edu] On Behalf Of Chris Hostetter
Sent: Tuesday, December 07, 2004 11:26 AM
To: Lucene Users List
Subject: Re: Filter !!!

 

 

:  Hits hits = indexSearcher.search(searchQuery, filter)   //  here I
want

: to pass multiple filter...  (DateFilter,QueryFilter)

 

You can write a Filter that takes in multiple filters and ANDs them

together (or ORs them, it's not clear what you want)

 

   Hits h = s.search(q,new AndFilter(df,qf));

 

...

 

class AndFilter {

   final Filter a;

   final Filter b;

   public AndFilter(Filter a, Filter b) {

     this.a = a;

     this.b = b;

   }

   BitSet bits(IndexReader r) {

     return b.bits(r).and(a.bits(r));  // Correct this line I am getting
some error.

   }

}

 

 

(I'm planing on writting a generalized "BooleanFilter" class sometime

in the next few weeks)

 

-Hoss

 

 

---------------------------------------------------------------------

To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org

For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message