If I understand your question correctly, you want to find all nodes whose
node name matches some pattern?

You can do an xpath query that does an exact match of the node name with the
fn:name() function like this:
   /jcr:root/content/david//element(*,nt:unstructured)[fn:name()
= 'myNodeName')]

But as far as I know, the jcr:like or jcr:contains will not work to do a
wildcard search of the node name since the name is not a property of the
node.

I generally like to add a 'displayName' property to each node that I can use
to query for and display in the UI since node name is often not very user
friendly.

Regards,
-Eric

On Thu, Jul 29, 2010 at 9:19 AM, Federico Paparoni <
[email protected]> wrote:

> Hi Eric,
>
> 2010/7/29 Eric Norman <[email protected]>
>
> > Hi Federico,
> >
> > I believe the following query would do what you are asking for.  The
> xpath
> > query uses the "//" abbreviation for the descendant-or-self axis.
> >
> > var query =
> > queryManager.createQuery("/jcr:root/content/david//element(*,
> > nt:unstructured) order by @created descending", "xpath");
> >
> > Regards,
> > -Eric
> >
> >
> Thanks, this works, but anyway not all nodes have the same property, so
> probably I'll use the previous query.
> If I search in this way I get all the nodes, if I want to get a node with a
> particular property I can write
>
> /jcr:root/content/david//element(*,nt:unstructured)[jcr:like(@title,
> '%WORD%')]
>
> but if I want to search all nodes with the name like to some words?
>
> --
> Federico
>

Reply via email to