ADOBE CQ5 JCR - How to orderby/sorting query builder result using node's property

谁说胖子不能爱 提交于 2019-12-09 07:08:25

You were almost there. It can be done as follows.

map.put("orderby", "@created"); 
map.put("orderby.sort", "desc"); // in case you want it descending

In case you need to check property within a child node, you can provide the relative path to that for the orderby value. For eg., if you are searching for dam:Asset and want to order them based on the jcr:lastModified property of its metadata, then your query would be something similar to this.

map.put("path", "/content/dam/geometrixx");
map.put("type", "dam:Asset");
map.put("orderby","@jcr:content/metadata/jcr:lastModified");

For further learning refer this

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!