From users-return-15458-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Fri Jun 25 10:17:41 2010 Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 75136 invoked from network); 25 Jun 2010 10:17:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Jun 2010 10:17:41 -0000 Received: (qmail 25688 invoked by uid 500); 25 Jun 2010 10:17:41 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 25383 invoked by uid 500); 25 Jun 2010 10:17:38 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 25374 invoked by uid 99); 25 Jun 2010 10:17:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jun 2010 10:17:37 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aklimets@day.com designates 207.126.148.85 as permitted sender) Received: from [207.126.148.85] (HELO psmtp.com) (207.126.148.85) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 25 Jun 2010 10:17:30 +0000 Received: from source ([209.85.161.173]) by eu3sys201aob102.postini.com ([207.126.154.11]) with SMTP ID DSNKTCSCIqqlsh0bPO94m0NyM56xH5LvgJ0e@postini.com; Fri, 25 Jun 2010 10:17:10 UTC Received: by gxk6 with SMTP id 6so32390gxk.18 for ; Fri, 25 Jun 2010 03:17:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.163.13 with SMTP id l13mr627912ane.267.1277461025645; Fri, 25 Jun 2010 03:17:05 -0700 (PDT) Received: by 10.100.7.19 with HTTP; Fri, 25 Jun 2010 03:17:05 -0700 (PDT) In-Reply-To: <4C2479EA.8010402@magillem.com> References: <4C2479EA.8010402@magillem.com> Date: Fri, 25 Jun 2010 12:17:05 +0200 Message-ID: Subject: Re: How to handle the colon character within fulltext search? From: Alexander Klimetschek To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Jun 25, 2010 at 11:42, Gary Long wrote: > Hello there :) > > I'm using the fulltext search feature of Jackrabbit and i'm facing a little > problem with the colon character (:). For example, if I search for a mail > which subject is "Tr : Tr : your response", I can't find it. If I search for > "your response" the e-mail is found. > > my sql query is : > > SELECT * FROM mnt:resource WHERE (contains(jcr:text, '*tr: tr: your > response*') OR contains(jcr:name, '*tr: tr: your response*'); You should escape the query for the contains/jcr:contains function using the Text.escapeIllegalXpathSearchChars helper from jackrabbit-jcr-commons: http://wiki.apache.org/jackrabbit/EncodingAndEscaping#Escaping_values_in_queries Regards, Alex -- Alexander Klimetschek alexander.klimetschek@day.com