lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mag Gam" <magaw...@gmail.com>
Subject Re: Query parser.parse (line);
Date Thu, 24 Aug 2006 00:45:32 GMT
Hi Erik, thanks for the quick reply

I am looking at this page
http://today.java.net/pub/a/today/2003/11/07/QueryParserRules.html

Any chance there is a new version for 2.0? Or are there any 2.0 examples
(other than the stock example)?



On 8/23/06, Erik Hatcher <erik@ehatchersolutions.com> wrote:
>
>
> On Aug 23, 2006, at 7:24 PM, Mag Gam wrote:
> > I am trying to do a Query parse line in a doGET method (J2EE).
> >
> > I keep getting this type of message;
> > unreported exception org.apache.lucene.queryParser.ParseException;
> > must be
> > caught or declared to be thrown
> >
> > Anyone have an example of a Class being thrown an exception?
> >
> > I would kindly appreciate it.
>
> The simplest thing would be something like this in a servlet:
>
> try {
>    Query query = parser.parse(...);
> }
> catch (ParseException pe) {
>    throw new IOException(pe.getMessage());
> }
>
> But you may not want the user to see that harsh of an error from your
> servlet when an unparsable expression is used.  Typically that
> exception is caught and a friendlier message is provided to the user.
>
>         Erik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message