jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Kruger <stephen.kru...@yahoo.com>
Subject Unable to find a way to efficiently sort by child size ?
Date Sat, 28 Jan 2012 19:05:42 GMT
Hi,

I'm struggling to write a query to return me the node which has the largest amount of children.

For example given : 

root
-A
--a1
--a2
--a3
-B
--b1
--b2
-C
--c1

it should return A (potentially followed by B and then C, but I'm only really interested in
A).

My current code simply iterates through the Level 1 nodes A,B,C etc and for each one run a
"//* order by xxx" and gets the getRows().getSize().

However the performance of this is obviously quite bad, but I'm unable to find anything like
"//* order by jcr:childcount"

Does anyone have any insights into an efficient way to do this? I'm happy to use JQOM if that
might be easier.

regards
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message