jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: How to handle the colon character within fulltext search?
Date Sat, 26 Jun 2010 16:04:41 GMT
On Fri, Jun 25, 2010 at 13:59, Gary Long <long@magillem.com> 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
alexander.klimetschek@day.com

Mime
View raw message