Hello,

You can search the archives (mail from me) for wildcard searching
things related below. There was someone having similar issues. I
explained the wildcard difficulties. Take a look at jcr:like for your
usecases

Regards Ard

On Thu, Aug 26, 2010 at 10:19 AM, Dunstall, Christopher
<[email protected]> wrote:
> Hi all,
>
> I'm having some trouble with an XPath query, where I'm searching for users 
> with hyphens in their name.
>
> I'm using:
> jcr:contains(*/*/*,'query')
>
> And it returns some odd results.
>
> I have two users, Sophie-Allen and Sophie-Anne. When I search for 'sophie', I 
> get back users back. Ok, fine, but if I search for 'sophie-a' (with the 
> hyphen escaped as 'sophie\-a' as per the JSR-170 Spec) I get zero results 
> returned.  Oddly, if I search for either 'sophie-allen' or 'sophie-anne' I 
> get the respective user details back fine. Shouldn't I get both users back 
> when escaping the hyphen? Have I missed something in the spec?
>
> One other odd thing is the addition of an asterisk (*).  Searching for 'soph' 
> and 'soph*' return the same result (both users), but if I search for 
> 'sophie-allen*', I get zero results, unlike when searching for just 
> 'sophie-allen'. Searching for 'sophie-a*' has the same result as without the 
> asterisk, i.e. nothing.
>
> The JSR-170 spec doesn't say anything (that I can find) but is the asterisk a 
> wildcard in the jcr:contains function or does it serve some other purpose?
>
> Your assistance is greatly appreciated,
>
> Regards,
>
> Chris Dunstall | Service Support - Applications
> Technology Integration/OLE Virtual Team
> Division of Information Technology | Charles Sturt University | Bathurst, 
> NSW, Australia
>
> Ph: 02 63384818 | Fax: 02 63384181
>

Reply via email to