Expand my Community achievements bar.

Get report of external videos used on a site

Avatar

Level 8

Hi 

I have a site 'XXX' I want to get a report of how many external videos are there for xxx.com site

For suppose I have created a page( /content/xxx/en-in/test-page) on this page I added an external video(youtube)

Vani1012_0-1680612645740.png

 

 

 

I used this query to get the list
path:
/content/xxx
type:dam:Asset

property=metadata.videoSource 

property.value=YOUTUBE
also this query
path:/content/<XXX>//element(*, cq:Component)[@videosource-YOUTUBE]
orderby=path

I am not getting any result can anyone help me

13 Replies

Avatar

Community Advisor

You authored it on aem pages and in your query you are using type as type:dam:Asset which is incorrect. You need to select the type as page node type that you are looking for.

there will be different way of creating the query. You can also work with full text query.

pleas follow below docs to create the query https://gist.github.com/floriankraft/8b3720464318cd5cd9e2

https://aemcorner.com/aem-query-examples-and-tips/

 

Avatar

Community Advisor

path=/content/xxx

fullext=YouTube

orderby=path

p.limit=-1

 

or

 

path=/content/xxx

type=cq:page

property=metadata.videoSource 

property.value=YOUTUBE

orderby=path

p.limit=-1

 

Avatar

Level 8

I used this query its not returning any results

path=/content/xxx
type=cq:page
property=metadata.videoSource
property.value=YOUTUBE
orderby=path
p.limit=-1

This query returns all pages under xxx

path=/content/xxx

fullext=YouTube

orderby=path

p.limit=-1

This is not expected behaviour, Can you share any other query

Avatar

Community Advisor

Hi this query works on my side

 

path=/content/xxx
type=cq:page
property=sling:resourceType 
property.value=your authored component path
orderby=path
p.limit=-1

 other one is

path=/content/xxx
type=cq:page
property=jcr:content/redirectTarget
property.operation=exists

orderby=path

p.limit=-1

Avatar

Level 8

path=/content/xxx
type=cq:page
property=sling:resourceType 
property.value=your authored component path
orderby=path
p.limit=-1

The query is to list page which uses so and so component na,

But my requirement is to get list of external videos used on aem site.

For example I have 500 plus of external assets configured on different pages using different components.

How to get the list of how many external videos are added on xxx site

 

Avatar

Community Advisor

The initial screenshot is not so clear to me. Can you share the good quality screenshots of your content node highlighting the value that you wants to search 

 

Avatar

Community Advisor

Full text query is working for me in my local. The result is giving the authored node path.

 

are you referring to have the authored value as well in query results?

Avatar

Level 8

Can you share the full text query, So that I can check from my end.

Q: Are you referring to have the authored value as well in query results?

A: I didnt get you

What I want is just want pages path which are having external videos

Avatar

Community Advisor

path=/content/xxx

fulltext=aem

orderby=path

p.limit=-1

 

above query works for me

Avatar

Level 8

The property is videosource not videotitle

And also I already mentioned this query returning all pages under xxx site

path=/content/xxx

fullext=YouTube

orderby=path

p.limit=-1

Avatar

Community Advisor

It should provide you the node path and not the page. Can you  check with random node present on the result if that’s value is present there or not. My be you need to look for other text in full text that describes or limits your search to the expected result