I want to search for a keyword in Javascript files that exists as DAM file in AEM. Javascript are saved as nt:file and data resides in jcr:data, is it possible to search for a keyword in these? With xPath or SQL2? Any other options for suggestions?
Thank you,
Nitish
Views
Replies
Total Likes
Hi @j408 ,
Yes, you can search for a keyword in JavaScript files that are saved as DAM files in AEM. AEM provides querying capabilities using XPath and SQL2 . However, as of my knowledge SQL2 is the more recommended approach for querying JCR nodes including DAM assets. XPath is supported but might have limitations and could be less efficient for complex queries. The query will be something like this
SELECT * FROM [nt:file] AS file
WHERE ISDESCENDANTNODE(file, '/content/dam/example')
AND CONTAINS(file.*, 'your_keyword')
Hi,
Thank you for your response.
We have tried that, but it is giving no results.
SELECT * FROM [nt:file] AS file WHERE ISDESCENDANTNODE(file, '/content/dam/ph/page%20embedded/') AND CONTAINS(file.*, 'emailURL')
Thanks,
Nitish
Hello @j408
I am able to find the asset with following query
path=/content/dam
fulltext=rootpath
type=dam:Asset
damAssetLucene considers "jcr:content/renditions/original" for aggregates. Thus, indexing the data in original rendition
Hi @aanchal-sikka,
Thank you for this.
I have already tried this in QueryBuilder, but it is not behaving as expected. I am using 6.5.13.
path=/content/dam/...
fulltext=my_keyword
type=dam:Asset
Thanks,
Nitish
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies