Thursday, November 21, 2013

Indexing all VPP files with EPiServer 7 and Find

Recently a customer had a problem with a pdf file that didn’t show up on a searchresult page.
Some pdf files was working but others wasn’t. 

The EPiServer Find client configured like this:
FileIndexer.Instance.Conventions.ShouldIndexVPPConvention = new VisibleInFilemanagerVPPIndexingConvention();

Made sure that all vpp folder settings was set to visible in file manager. (showinfilemanager in episerverframework.config).

The problem file was in the Page files folder. So I went to the Find API docs:

And voila, there was the answer, not 100% obvious but here it is, how to index VPP files with Find and Page files as well:
[ModuleDependency(typeof (IndexingModule))]
            public class FindInitialization : IConfigurableModule
                         public void Initialize(InitializationEngine context)
                                     FileIndexer.Instance.Conventions.ShouldIndexVPPConvention = new VisibleInFilemanagerVPPIndexingConvention();
                             ----> ContentIndexer.Instance.Conventions.EnablePageFilesIndexing();

So we add this line:
Find docs says this convention should be in the PageIndexer class but now its called ContentIndexer.