Hi everyone,
I have a requirement where I need to search for all the assets with a particular property. I am trying to use Query Builder API for it. My assets are under multiple different folders under /content/dam. They can be in /content/dam/abc or /content/dam/abc/def or even /content/dam/ghi. There can be multiple child folders or parallel folders where my assets are present. How do I search for all assets which have one property in common in all these different paths? If I use path=/content/dam in my query, it doesn't give any result as all my assets are in one or the other folder but since there are multiple folders I cannot give one definite path. I am using AEM 6.4.2
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Where you are querying, /content/dam, will show you 0 results, it maybe because your AEM platform has reached the maximum node traversal, LimitReads of 10,000. You will need to change the limit from your environment's system/console, but please be warned as when you increase this number, it may affect the overall performance.
Give this a try.
In order to find for all assets with particular property, you can use
path=/content/dam
type=dam:Asset
property=jcr:content/metadata/dc:format
property.value=image/png
p.limit=-1
The above query should search in depth to get all assets.
If you are looking for defining multiple paths in query, you can use something like that:
group.p.or=true
group.1_path=/content/dam/we-retail-screens
group.2_path=/content/dam/we-retail
property=jcr:content/metadata/dc:format
property.value=image/png
p.limit=-1
Hope it helps!
Thanks!
Nupur
if I give path=/content/dam it returns error for me. Only If I give complete asset folder path I get the resultset. But I do not know which all folders might have the asset with the required property. It can be under any folder under /content/dam and can be under under multiple child folders like /content/dam/abc/asset.jpg or /content/dam/abc/def/asset.jpg or content/dam/ghi/asset.jpg. Only the root folder I know which is /content/dam
Views
Replies
Total Likes
Can you put your error here? Also, I guess the error is traversal error and you might have to index the property you are searching as the number of assets must be large in number.
I would be able to tell better after looking at your exception.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
You will have to add your property to OOTB dam index so that properties on which your search is working are indexed and your resultset is retrived via index instead of traversing the whole dam content structure.
/oak:index/damAssetLucene is OOTB dam index where you have to add your properties under /oak:index/damAssetLucene/indexRules/dam:Asset/properties and reindex this index afterwards.
There are some references you must read before making any change in index:
https://docs.adobe.com/content/help/en/experience-manager-64/deploying/deploying/queries-and-indexin...
https://jackrabbit.apache.org/oak/docs/query/lucene.html(This will give you fair idea on how you should add the property)
Hope it helps!
Thanks!
Nupur
Views
Replies
Total Likes
is there a way to do same things via postman
Views
Replies
Total Likes
Views
Replies
Total Likes
Can you share the query you are trying now ? If you are giving path as /content/dam , it should eventually look under evry folder below dam . So the issue might be with the rest of the properties you are giving. @Nupur_Jain has put some sample queries. Please check if any of those helps ?
Thanks
Veena
Where you are querying, /content/dam, will show you 0 results, it maybe because your AEM platform has reached the maximum node traversal, LimitReads of 10,000. You will need to change the limit from your environment's system/console, but please be warned as when you increase this number, it may affect the overall performance.
Give this a try.
Views
Likes
Replies
Views
Likes
Replies