thank you! that's it :-) Paul
On Wed, 29 Dec 2004 19:07:05 +0100, Morus Walter <[EMAIL PROTECTED]> wrote: > Paul writes: > > > the following code > > QueryParser qp = new QueryParser("itemContent", analyzer); > > > > qp.setOperator(org.apache.lucene.queryParser.QueryParser.DEFAULT_OPERATOR_AND); > > Query query = qp.parse(line, "itemContent", analyzer); > > doesn't produce the expected result because a query "foo bar" results in: > > itemContent:foo itemContent:bar > > where as a "foo AND bar" results in > > +itemContent:foo +itemContent:bar > > > > If I understand the default operator correctly than the first query > > should have been expanded to the same as the latter one, isn't it? > > > try qp.parse(line). > parse(String query, String field, Analyzer analyzer) is a static method > that create it's own instance of QP, that does not know anything about > the settings of your qp object. > > Morus > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]