November Happy Hour will be moved to Thursday December 5th.

Query to return all unused assets

Vote:
 

Hi everyone,

I need to come up with a query that returns all unused assets (assets that are not referenced anywhere).

I have tried using the PowerSlice tool but it seems its quite restrictive in terms of how many results it can return and has no paging (I've estimated that there could be around 10000 unused assets).

Im thinking that creating a plugin could be the way forward.

Could anyone recommend an approach that performs well?

Thanks in advance,

Adam

#147048
Apr 05, 2016 10:38
Vote:
 

The easy variant will probably be to create a scheduled job that goes through the media items one by one and checks for references and then creates a report in an excel format or similar. Then you can run the job during off hours and don't need anything expensive search solution etc. If you are fine with a summary every day or so then this will likely be the easiest development route. It will likely take quite some time to run and put a bit of load on server during that time.

A more advanced version is to use EPiServer Find and add a custom field on each media to store whether it's used or not. Then you will need to build some custom logic to when content is published to check what references has disappeared or been added and update the index for those media items. When you got that information in index you can query that and get instant replies so if you need "live" results and performance then this is probably the way. It will not noticably put any load on server.

#147049
Edited, Apr 05, 2016 11:32
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.