On Fri, Jun 25, 2010 at 13:59, Gary Long <[email protected]> wrote:
> 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. : /

Oh, this might be due to the fact of using SQL. I though the method
would work for both cases, as it is essentially an escaping for the
lucene full text search (IIUC).

Something must happen in the SQL query parser then, since
escapeIllegalXpathSearchChars() clearly escapes colons. See
http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Text.java

Regards,
Alex

-- 
Alexander Klimetschek
[email protected]

Reply via email to