Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 73723 invoked from network); 6 Jun 2006 21:57:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jun 2006 21:57:36 -0000 Received: (qmail 87181 invoked by uid 500); 6 Jun 2006 21:57:30 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 87145 invoked by uid 500); 6 Jun 2006 21:57:30 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 87134 invoked by uid 99); 6 Jun 2006 21:57:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 14:57:29 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [169.229.70.167] (HELO rescomp.berkeley.edu) (169.229.70.167) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 14:57:29 -0700 Received: by rescomp.berkeley.edu (Postfix, from userid 1007) id 454915B775; Tue, 6 Jun 2006 14:57:06 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rescomp.berkeley.edu (Postfix) with ESMTP id 3D4267F403 for ; Tue, 6 Jun 2006 14:57:06 -0700 (PDT) Date: Tue, 6 Jun 2006 14:57:06 -0700 (PDT) From: Chris Hostetter To: java-user@lucene.apache.org Subject: Re: Avoiding ParseExceptions In-Reply-To: <359a92830606061401g3fc493bdoecb03dd65790b5d0@mail.gmail.com> Message-ID: References: <359a92830606061401g3fc493bdoecb03dd65790b5d0@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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