Search code examples
sortingaemdam

dam search/sort based on file size


How can I sort my search based on file size in DAM. I'm trying this and the sorting doesn't seem to work maybe because dam:size is a string:

type=dam:Asset
path=/content/dam/<my_project>
nodename=*.pdf
orderby=@jcr:content/metadata/dam:size
orderby.sort=desc

Solution

  • With XPath, you can do it like this: /jcr:root/content/dam/<site>//element(*,dam:Asset) order by jcr:content/metadata/@dam:size descending