lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spinergywmy <>
Subject Re: Filter query method
Date Wed, 08 Nov 2006 01:04:45 GMT

Hi Chris,

   I have made some modification for the codes that I have posted yesterday.

      reader =;
			Searcher searcher = new IndexSearcher(reader);
			Analyzer analyzer = new StandardAnalyzer();
			QueryParser parser = new QueryParser(DsConstant.idxFileContent,
			Query query1 = parser.parse(searchString1);
			Query query2 = parser.parse(searchString2);
			filter = new Filter(){
				public BitSet bits (IndexReader reader){
					System.out.println("inside bit set");
					BitSet bits = new BitSet(reader.maxDoc());
					System.out.println("bits size is ::: " +bits.size());
					for(int i=start; (i<end && i<bits.size()); i++) 
					return bits;
			BooleanQuery bq = new BooleanQuery();
		    query1 = new FilteredQuery(new MatchAllDocQuery(), filter);
		    bq.add(query1, BooleanClause.Occur.MUST);
		    bq.add(query2, BooleanClause.Occur.MUST);
		    searchHits =;

   Can you pls point me out which part I have done it wrong. Thanks.

Wooi Meng
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message