Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

How to find particular image log exists on what pages using SQL2 query?


Level 3

I have a requirement where I need a list of pages, just to know that a particular image logo exists on what pages. 

As highlighted in the following image, I need all the pages with property imageReference set as "company-horiz-blk.png"






So I need to write a SQL2 query regarding this.

Any help would be appreciated.


2 Replies


Community Advisor

Try giving the path of the content structure in the Path and the string or the reference you want to search in the Text below and Generate and Execute the query. It should display the results.


Let me know if this doesn't works!!


Community Advisor

Hi @touseefk2181136 


SQ2 to search for image References with particular image can be searched with 

SELECT * FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE (node, '/content/we-retail') AND node.[imageReference] = '/content/dam/we-retail/en/activities/climbing/indoor-practicing.jpg'


The above query will search for all the paths where imageReference is present.

I would say if you want to search for logo imageReference specifically, you can also add sling:resourceType of the logo as well in the search like


SELECT * FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE (node, '/content/we-retail') AND node.[imageReference] = '/content/dam/we-retail/en/activities/climbing/indoor-practicing.jpg' AND node.[sling:resourceType] = 'foundation/components/image'


Hope it helps!