From java-user-return-35291-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Mon Aug 04 10:06:26 2008 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 47411 invoked from network); 4 Aug 2008 10:06:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Aug 2008 10:06:25 -0000 Received: (qmail 40754 invoked by uid 500); 4 Aug 2008 10:06:17 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 40733 invoked by uid 500); 4 Aug 2008 10:06:17 -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 40721 invoked by uid 99); 4 Aug 2008 10:06:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2008 03:06:16 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kalanir@gmail.com designates 74.125.46.28 as permitted sender) Received: from [74.125.46.28] (HELO yw-out-2324.google.com) (74.125.46.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2008 10:05:22 +0000 Received: by yw-out-2324.google.com with SMTP id 3so943677ywj.5 for ; Mon, 04 Aug 2008 03:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=iJaQbPv5XfL7jlsMJWTWyLGmjmC3DiCgZd+cIKcHQPw=; b=tmnstKlWAjhPjxjjtuz8cpuWEXphkSysKdWuuVCIrpA6YQfpKoiGjKVMl3OhPwiSA4 5eRTzJ+vbnYVuC0mV2rga+/v0CuMu7W6brhnBJeJtpU9ungrROhFq6jw0GX6xmkozdN8 eIP3TV1BjXJlQiMY+NHbBmZ4ELdjKN4vr0FR0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=iMToQAPXrrAcH6VqfFeIpHLLFtSzJVmGngXiRzR86drRGgAoW9DlPQJYHplrXiJIXB ps1KA8pxP+mlMGz8wlcz2n8mNN2smYaJp+DI3zvdo0z90EXPXnK9bbX/akYdl2m5RCfr ygIMzImvgysgAUslx6x5J2IflpO8Tu8jcBqvk= Received: by 10.151.149.14 with SMTP id b14mr1011751ybo.236.1217844349072; Mon, 04 Aug 2008 03:05:49 -0700 (PDT) Received: by 10.151.84.16 with HTTP; Mon, 4 Aug 2008 03:05:48 -0700 (PDT) Message-ID: <5816fbdd0808040305h33563ed5rd275e833ac3993dc@mail.gmail.com> Date: Mon, 4 Aug 2008 15:35:48 +0530 From: "Kalani Ruwanpathirana" To: java-user@lucene.apache.org Subject: escaping special characters MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11453_12761055.1217844348893" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_11453_12761055.1217844348893 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I followed the following procedure to escape special characteres. String escapedKeywords = QueryParser.escape(keywords); Query query = new QueryParser("content", new StandardAnalyzer()).parse(escapedKeywords); this works with most of the special characters like * and ~ except \ . I can't do a search for a keyword like "ho\w" and get results. am I doing anything wrong here. Thanks, Kalani -- Kalani Ruwanpathirana Department of Computer Science & Engineering University of Moratuwa ------=_Part_11453_12761055.1217844348893--