My webapp is developed with Lucene 1.4.3 and I want to upgrade the Lucene library to version 2.0
But in Lucene 2.0, the MultiFieldQueryParser class was deprecated. I try to rewrite the code using a BooleanQuery as follows. Original code: String[] fields = {"TERM_A","TERM_B"}; query6 = MultiFieldQueryParser.parse(keyword,fields,analyzer); Rewritten code: QueryParser qp = new QueryParser("TERM_A",new StandardAnalyzer()); Query q1 = qp.parse(keyword); qp = new QueryParser("TERM_B",new StandardAnalyzer()); Query q2 = qp.parse(keyword); BooleanQuery booleanQuery = new BooleanQuery(); booleanQuery.add(q1,BooleanClause.Occur.SHOULD); booleanQuery.add(q2,BooleanClause.Occur.SHOULD); query6 = booleanQuery; Is this correct??? Thanks Ferdinand