Hi, Jop Zinkweg - Initworks B.V. wrote: > Hi, > > We're currently developing a web application which (will) use Jackrabbit > to store all of its correspondence. > > What I'm trying to do is to search through a subtree containing files, > and return these in a specific order based on a property in the > jcr:content subnode. > > For testing purposes I'm using the search page in jackrabbit-webapp. > > My XPath query looks like: > stmt = "jcr:root/people//element(*, nt:file)[jcr:contains(jcr:content, > '" + q + "')]/rep:excerpt(.) order by @jcr:content/bos:date ascending" > > The query works fine, returning the nodes I'm expecting, but I can't get > the ordery by to work. > > Is ordering by subnode properties in any way supported?
no, this is currently not supported. see [0] and [1] > I suspect this is not the case, since a node might have more than one > subnode of the same name? > > My next step would be to retrieve jcr:content nodes, since 99% of my > search options relate to the jcr:content properties, and access the > parent node in java, but I'm hoping there's a better solution. that's currently the only thing you can do. > (I know subpath lookups are a bad idea performance wise, it's something > that'll be changed later on) do you mean the call to get the parent (nt:file) node of your result nodes? that shouldn't be a big deal. regards marcel [0] https://issues.apache.org/jira/browse/JCR-800 [1] https://issues.apache.org/jira/browse/JCR-777 > Regards, > > Jop Zinkweg > Initworks B.V. > >
