lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulo Silveira" <paulo.silve...@caelum.com.br>
Subject Re: MultiFieldQueryParser.parse deprecated. What can I use?
Date Wed, 26 Jul 2006 02:35:48 GMT
hey doron, I solved the problem with

for (String field : fields) {
	QueryParser qp = new QueryParser(field, SearchEngine.ANALYZER);
	fieldsQuery.add(qp.parse(string), BooleanClause.Occur.SHOULD);
}

that seems to have the exact same effect of your suggestion
	
MultiFieldQueryParser qp = new MultiFieldQueryParser(fields,
SearchEngine.ANALYZER);
fieldsQuery = qp.parse(string);

thanks a lot!!


On 7/25/06, Doron Cohen <DORONC@il.ibm.com> wrote:
> (Seems 1.9 javadoc could be just a bit more clear on this.)
> The following should do the work:
>    QueryParser qp = new MultiFieldQueryParser(fields[], analyzer);
>    Query = qp.parse(qtext);
> Notice the difference in semantics as explained in the "deprecated" comment
> in 1.9.
> Also see the setDefaultOperator() in the (2.0) constructor.
>
> Regards,
> Doron
>
> paulo.silveira@gmail.com wrote on 24/07/2006 22:22:08:
>
> > Hello
> >
> > What can I use as a drop in replacement? I mean, about the (String,
> > String[], Analyzer) one.
> >
> > The 1.9.1 javadoc says to use QueryParser.parse, but I need to
> > construct the query first. Any util method or do I need to do the for?
> > If this is the solution, maybe it is more elegant to use the for to
> > create a big BooleanQuery, .adding new BooleanClause.Occur.Must
> > clauses each loop?
> >
> > thanks
> >
> >  --
> > Paulo E. A. Silveira
> > Caelum Ensino e Soluções em Java
> > http://www.caelum.com.br/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
Paulo E. A. Silveira
Caelum Ensino e Soluções em Java
http://www.caelum.com.br/

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message