You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Paul <pa...@gmail.com> on 2004/12/29 01:09:02 UTC

QueryParser, default operator

Hi,
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?

thanks a lot!
Paul

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