Subject: Re: Escaping % sign in a query



did you try this?

CONTAINS(s.*, '\%\%myword\%\%')

Best regards,
Clay Ferguson
[email protected]


On Wed, Jan 11, 2017 at 11:18 AM, Roy Teeuwen <[email protected]> wrote:

> Hey all,
>
> I am trying to do a query where the actual word I am looking for looks
> like %%myword%%. I have tried the following in XPATH and JCR_SQL2, but it
> seems that the % sign is in both query languages a wildcard, meaning i will
> find all the nodes containing myword instead of %%myword%%. How can I
> escape the % sign in either XPATH or JCR_SQL2?
>
> JCR_SQL2:
> SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/myfolder])
> and CONTAINS(s.*, '%%myword%%')
>
> XPATH:
> /jcr:root/myfolder//*[jcr:contains(., '%%myword%%')]
>
> Thanks!
> Roy
...



Programming list archiving by: Enterprise Git Hosting