jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From François Cassistat <f.cassis...@maya-systems.com>
Subject Re: XPath Question
Date Sat, 05 Feb 2011 18:23:22 GMT
It does not work on sub levels.

jcr:contains(@property, 'test') is ok
jcr:contains(., 'test') is ok
jcr:contains(path/to/@property, 'test') is not ok

I've managed to make this work with a join in JQOM.

In XPath, you may look at the Index Aggregates section in IndexingConfiguration in the wiki
to includes content of descendant nodes on a parent node.



Le 2011-02-05 à 10:34, Alexander Saar a écrit :

> Hi all,
> I'd like to find all nodes of a certain type that have a sub node at some
> level with a certain property that contains a value I'm searching for. The
> following query works if I have a sub node two levels under the
> nt:unstructured node:
> /jcr:root//element(*, nt:unstructured)[jcr:contains(./*/*/@text, 'test')]
> order by @jcr:score
> But I don't know the exact level. So I tried the following:
> /jcr:root//element(*, nt:unstructured)[jcr:contains(.//@text, 'test')] order
> by @jcr:score
> This query doesn't return any hits. But I'd expect the same result set.
> Any ideas what I'm doing wrong?
> Thanks
> Alex

View raw message