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 Friedman <pf...@macromedia.com> on 2001/11/06 17:41:35 UTC

QueryParser.parse(...) javadoc is incorrect

To whoever maintains the javadocs...
 
The javadoc for QueryParser.parse(...) says that it throws a ParseException
if an error occurs, in fact, it throws an
org.apache.lucene.queryParser.TokenMgrError.
 
Thanks.
Paul

Re: QueryParser.parse(...) javadoc is incorrect

Posted by Brian Goetz <br...@quiotix.com>.
> The javadoc for QueryParser.parse(...) says that it throws a ParseException
> if an error occurs, in fact, it throws an
> org.apache.lucene.queryParser.TokenMgrError.

Actually, this is not quite correct.  

It throws a ParseException if it encounters a valid sequence of tokens
but which do not match the parsing rules.  For example, I'll bet 
  foo AND AND bar
would throw a ParseException, even though this is a sequence of valid
tokens.  

It throws a TokenMgrError when it cannot even assemble a sequence of
characters into a token.  This shouldn't happen; post the offending
query and I'll see if it can be fixed.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>