lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomcat Programmer <>
Subject QueryParser Rules article (Erik Hatcher)
Date Thu, 13 Nov 2003 04:52:47 GMT
I thought Erik's article was great. There was one
unanswered brainbender I had which I was hoping was in
there, but... Maybe you can add this topic to the next
one, Erik? 

Here is my issue: 

When using the QueryParser class, the parse method
will throw a TokenMgrError when there is a syntax
error even as simple as a missing quote at the end of
a phrase query. According to the javadoc, you should
never see this class derived from Error being thrown

I did some searching on the archive for this list, and
turned up some old articles from 2001 in which Brian
Goetz was asking Paul Friedman for an example of a
query like that, so he could fix it. I saw that Paul
posted a sample, but I never saw a response back from
Brian.  Looking in the CHANGES.txt file all the way
back to 1.0 there is no mention of any modification
regarding exceptions or errors. 

Has anyone discovered a good practice for trapping
syntax problems and then returning an informative
message to the user on how to fix their query? I would
be interested in code samples as well if you have any

Thanks a lot! 


Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message