lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Avoiding ParseExceptions
Date Tue, 06 Jun 2006 21:57:06 GMT

It really depends on what syntax you want to support ... if you just want
basic term matching and do't want to let hte user specify field names, or
boosts or phrases, or ranges, or wildcards -- then just escape the
entirestring, that should make it impossible to get a parse exception.

I took an approach similar to that, by escaping all of the "special'
characters except '+', '-', and '"', and then stripping out all quotes if
there was a non even amount ... this gave me a simplified version of the
Lucene syntax that was fairly safe.




-Hoss


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


Mime
View raw message