jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Brown <benjamin.br...@thisisnumero.com>
Subject Double String escaping - is it needed?
Date Tue, 10 Aug 2010 13:52:53 GMT
Hi,

According to the JSR-170 v1.0, p117 certain set of characters in a searchexp need escaping,
i.e.
"Within the searchexp literal instances of single quote ("'"), double quote (""") and hyphen
("-") must be escaped with a backslash ("\"). Backslash itself must therefore also be escaped,
ending up as double backslash ("\\"). "
In addition Lucene 2.4.x ( http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping%20Special%20Characters
) also requires a larger set of escaping i.e.:
"Lucene supports escaping special characters that are part of the query syntax. The current
list special characters are + - && || ! ( ) { } [ ] ^ " ~ * ? : \ "

In order to do a search in Jackrabbit, do I need to do apply both sets of escaping together?
E.g. to escape things such as double quotes does this end up as \\"  or will \" suffice?

What happens with single quotes I want to use in the Lucene query but need to escape for Jackrabbit?

Thanks,

Benjamin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message