Indexing only referenced files with EPiServer Find 7.5
Henrik wrote a very good blog post on this for the previous version of Find that you can find here:
http://www.lindstromhenrik.com/indexing-only-referenced-vpp-files-with-episerver-find/
If you want it to work with iContent all you have to change this:
Remove this:
FileIndexer.Instance.Conventions.ShouldIndexVPPConvention = new ShouldIndexVPPConvention(x => true);
Change this:
FileIndexer.Instance.Conventions.ForInstancesOf<UnifiedFile>().ShouldIndex(x =>
To:
ContentIndexer.Instance.Conventions.ForInstancesOf<IContentMedia>().ShouldIndex(x =>
Then change this row:
var softLinks = contentSoftLinkRepository.Load(x.VirtualPath);
To:
var softLinks = contentSoftLinkRepository.Load(x.ContentLink, true);
And it should be up and running!
Good luck!
Comments