You could try something like this. /jcr:root/content/dam//*[@jcr:primaryType='dam:AssetContent' and metadata/@dam:sha1='07614f5ec4a3bc5e3a822455fd52e1a0369429a0'] order by @jcr:scorePlease note that I have not tuned this query for performance, just something I cooked up.