lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mordo, Aviran (EXP N-NANNATEK)" <>
Subject RE: Avoiding ParseExceptions
Date Tue, 06 Jun 2006 21:01:22 GMT
Basically you need to pre-process the query and rewrite it in a way you
think it should be. Then catch the parse exception if you failed to
rewrite the query and display an error message on the screen (something
like - This kind of query is not supported, please rephrase your query).



-----Original Message-----
From: news [] On Behalf Of Chris Nokleberg
Sent: Tuesday, June 06, 2006 4:25 PM
Subject: Avoiding ParseExceptions

Hi all,

I am using the QueryParser with a StandardAnalyzer. I would like to
avoid or auto-correct anything that would lead to a ParseException. For
example, I don't think you can get a parse exception from Google--even
if you omit a closing quote it looks like it just closes it for you
(please correct me if you know otherwise).

Does anyone have suggestions on how to accomplish this? I imagine it
could require a mix of techniques:
- pre-processing the input string (e.g. I currently escape colons)
- catching generated exceptions and using the exception info to correct
  the string and retry the query
- a modified QueryParser?

The next step is probably to compile a list of all the ways a
ParseException can be generated, but I figured I should ask if this idea
has any merit first.


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

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

View raw message