public static Query parse(String query, String[] fields, Analyzer analyzer)
throws ParseException
{
BooleanQuery bQuery = new BooleanQuery();
for (int i = 0; i < fields.length; i++)
{
Query q = parse(query, fields[i], analyzer);
bQuery.add(q, false, false);
}
return bQuery;
}
Chris --
Otis Gospodnetic wrote:
I would like that change, as I don't always like queries that MFQP creates.
Otis
--- Daniel Naber <[EMAIL PROTECTED]> wrote:
Hi,
I'd like to fix MultiFieldQueryParser so that it properly works with
AND queries. Currently it rewrites AND queries so that all terms must
appear in all fields, which rarely makes sense.
Eric Jain suggested a new class that works for AND and OR queries:
http://issues.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1798116
It seems that his code can just be added to the current MultiFieldQueryParser class. The current static calls can then all be
deprecated (once some feature like setting required/prohibited per
field have been added to the new code).
Does anybody see a problem with that?
Regards Daniel
-- http://www.danielnaber.de
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- [EMAIL PROTECTED]
Aduna Prinses Julianaplein 14-b 3817 CS Amersfoort The Netherlands
+31 33 465 9987 phone +31 33 465 9987 fax
http://aduna.biz
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]