Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 2413 invoked from network); 25 Jun 2010 12:00:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Jun 2010 12:00:06 -0000 Received: (qmail 75922 invoked by uid 500); 25 Jun 2010 12:00:06 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 75683 invoked by uid 500); 25 Jun 2010 12:00:03 -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 75671 invoked by uid 99); 25 Jun 2010 12:00:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jun 2010 12:00:02 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [80.12.242.113] (HELO smtp2e.orange.fr) (80.12.242.113) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jun 2010 11:59:56 +0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e27.orange.fr (SMTP Server) with ESMTP id 596CA80001DF for ; Fri, 25 Jun 2010 13:59:34 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e27.orange.fr (SMTP Server) with ESMTP id 4AD6780002F3 for ; Fri, 25 Jun 2010 13:59:34 +0200 (CEST) Received: from [192.168.20.14] (LPuteaux-151-41-16-99.w217-128.abo.wanadoo.fr [217.128.31.99]) by mwinf2e27.orange.fr (SMTP Server) with ESMTP id 1CD5A80001DF for ; Fri, 25 Jun 2010 13:59:34 +0200 (CEST) X-ME-UUID: 20100625115934118.1CD5A80001DF@mwinf2e27.orange.fr Message-ID: <4C249A27.1030406@magillem.com> Date: Fri, 25 Jun 2010 13:59:35 +0200 From: Gary Long User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: users@jackrabbit.apache.org Subject: Re: How to handle the colon character within fulltext search? References: <4C2479EA.8010402@magillem.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Le 25/06/2010 12:17, Alexander Klimetschek a �crit : > 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 > > I tried this method but it didn't do anything : / Here is my code : String param = "Tr: Tr: your response"; String escapedParam = org.apache.jackrabbit.util.Text.escapeIllegalXpathSearchChars(param); String query = SELECT * FROM mnt:resource WHERE (contains(jcr:text, '*"+ escapedParam +"*') OR contains(jcr:name, '*"+ escapedParam +"*'). In debug mode, I looked at the value of textQuery in the query and it is still "Tr: Tr your response". The colon character doesn't seems to be escaped. : / Regards, Gary