I need to execute a Query Builder API (querybuilder.json) call to fetch all images that do not have the jcr:content/metadata/cq:tags property set to "region:Italy"; the images are saved on a specific path inside the Assets of Adobe Media Library
Please provide guidance on the necessary query builder syntax and any relevant API documentation.
Thanks.
Views
Replies
Total Likes
Hi,
Something like this should work:
path=/content/dam/yourFolder
type=dam:Asset
property=jcr:content/metadata/cq:tags
property.value=region:Italy
property.operation=not
p.limit=-1
where:
dam:Asset
for images).jcr:content/metadata/cq:tags
)."region:Italy"
.not
filters out the assets with the specified tag.-1
means no limit on the number of results.
Be careful that query a large folder as this can cause performance issues, and make sure you follow these best practices: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/query...
Here are some resources for querybuilder:
https://hashimkhan.in/2015/12/02/query-builder/
Hope this helps
Ciao! Unfortunately it doesn't work.
Hi @serenapitotti , please try below:
http://localhost:4502/libs/cq/search/content/querydebug.html
path=/content/dam/your-specific-path
type=dam:Asset
property=jcr:content/metadata/cq:tags
property.operation=unequals
property.value=region:Italy
p.limit=-1
My Anytime go to Query Builder link to go through for all possible answers:
Hi @serenapitotti ,
Below query works fine for me, I tested few scenario.
We need to use like operator because cq:tags field is multifield, hence equals operation will fails if there are more than one tag for the asset (i.e. region:Italy tag plus some other tag as well)
path=/content/dam/we-retail/en/people/mens
type=dam:Asset
group.property=jcr:content/metadata/cq:tags
group.property.operation=like
group.property.value=%we-retail:activity/biking%
group.p.not=true
p.limit=-1
Note:- It will fetch asset with empty tag (or no tag property) as well as it does not contains given tag
PS:- Kindly change the tag id group.property.value=%we-retail:activity/biking% and path=/content/dam/we-retail/en/people/mens as per your project.
If required you may narrow down only to image asset by using grouping
Thanks
@serenapitotti Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes