jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Double String escaping - is it needed?
Date Wed, 11 Aug 2010 14:19:42 GMT
On Wed, Aug 11, 2010 at 10:20, Benjamin Brown
<benjamin.brown@thisisnumero.com> wrote:
> -----Original Message-----
> From: Alexander Klimetschek [mailto:aklimets@day.com]
> Sent: 10 August 2010 23:46
> To: users@jackrabbit.apache.org
> Subject: Re: Double String escaping - is it needed?
>> Generally the escaping is necessary to differentiate between actually
>> looking for that literal including a special character (which mostly
>> isn't available in the full-text index anyway) or having those special
>> characters be used as part of the lucene search syntax.
> Thanks for the clarification - it's helped separate my understanding of the problem.
> I don't actually need to have the special lucene characters as I'll be adding fields
in future such as "Must not include" etc. for which we'll substitute the lucene characters
on behalf of the user.
> What this means is that the method I provided in the last post (but now using another
method name) is only suitable for our particular case as it provides for our requirements
of escaping the last character (side effect - by way of escaping lucene characters), escaping
the lucene characters, and removing single quotes.

Yes. What you always want to do is avoid invalid (lucene) query
exceptions, since they give you no result at all. This is what an odd
number of double-quotes will produce (where my method helps) or the
special lucene characters at the end of the string (where
Text.escapeIllegalXpathSearchChars() helps).


Alexander Klimetschek

View raw message