AEM 6.4.1.0 : Retrieve dam assets based on certain properties via querybuilder

cquser1 25-03-2019

The query tried is as below :

In http://localhost:4502/libs/cq/search/content/querydebug.html, they work fine. Even in crxde query options they work fine. Via code, when exceuted , doesnt work. Index related errors seen in logs. Created custom indexes as well and getting picked up as well, but that doesn't seem to be the problem.

The issue seems to be the way in which querybuilder predicates[mentioned in #1 and #2 below] are being tried.

property2 to property7. All of them are different properties present under metadata.

#1]

type=dam:Asset

path=/content/dam/xxx

orderby=@jcr:content/jcr:lastModified

orderby.sort=desc

group.2_group.property=jcr:content/metadata/dita_class

group.2_group.property.value=- map/map

group.1_group.p.or=true

group.1_group.1_property=jcr:content/metadata/property2

group.1_group.1_property.value=admin[logged in user]

group.1_group.2_property=jcr:content/metadata/property3

group.1_group.2_property.value=admin[logged in user]

group.1_group.3_property=jcr:content/metadata/property4

group.1_group.3_property.value=admin[logged in user]

group.1_group.4_property=jcr:content/metadata/property5

group.1_group.4_property.value=admin[logged in user]

group.1_group.5_property=jcr:content/metadata/property6

group.1_group.5_property.value=admin[logged in user]

group.1_group.6_property=jcr:content/metadata/property7

group.1_group.6_property.value=admin[logged in user]

location=asset

location.suggestion=Assets

#2]

type=dam:Asset

path=/content/dam/xxx

orderby=@jcr:content/jcr:lastModified

orderby.sort=desc

property=jcr:content/metadata/dita_class

property.value=- map/map

group.p.or=true

group.1_property=jcr:content/metadata/property2

group.1_property.value=admin

group.2_property=jcr:content/metadata/property3

group.2_property.value=admin

group.3_property=jcr:content/metadata/property4

group.3_property.value=admin

group.4_property=jcr:content/metadata/property5

group.4_property.value=admin

group.5_property=jcr:content/metadata/property6

group.5_property.value=admin

group.6_property=jcr:content/metadata/property7

group.6_property.value=admin

location=asset

location.suggestion=Assets

Any thoughts/pointers/reference code on this will be really helpful.

Answers (3)

Answers (3)

cquser1 25-03-2019

#1 and #2 were variations I was trying out at my end, to achieve the end result. Probably I was not too clear.

Basically the motive is to list all assets having a specific property present as part of "jcr:content/metadata/dita_class" property and look for logged-in user value in any of the 6 metadata properties.