jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Omid Milani <omil...@gmail.com>
Subject count function in query?
Date Mon, 19 Jul 2010 14:27:32 GMT

I'm implementing a tag cloud in JCR. I wanted to write a query to
return tags and number of articles tagged with each, similar to RDBMS
  select tag, count(*) as count from article_tag and tag where
article_tag.tag=tag.id group by tag order by count
I expected something like this to do it in jcr
  /tags/tag( node() |
count(//article/tag[@tag-link=node()/@jcr:uuid])) order by count(...)
It doesn't. I couldn't find a way to do it with sql2 and qom either,
seems there's no count function defined in any of them.

Now, for tag cloud, I did without that query, by keeping count of
links in tag's node for each article tagged. But this seems an
important feature. Is there some way to do this in JCR or Jackrabbit?
Would it be supported in some point in future? Or should one use
relational database cases that require such queries?

View raw message