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

Avoid indexing contentassetfolder/Media Images

Vote:
 

Hi,

I've just integrated our episerver site with Find (Episerver version : 8, Episerver Find version: 9.2) . I tried to index from admin mode (using the content indexing job).

I'm seeing that our contentassetsfolder/media images are also getting indexed to Episerver Find Index. Can you please let me know how I can avoid indexing images/content assets folders.

Thanks in advance.

#148131
May 04, 2016 11:44
Vote:
 

You can customize what you want to index by using conventions in EPiServer Find

//using EPiServer.Find.Cms.Conventions;
 
ContentIndexer.Instance.Conventions
  .ForInstancesOf<LoginPageType>()
  .ShouldIndex(x => false);

...preferably at application startup or similar. So add conventions like above to remove the content types you are not interested in getting search hits from. 

You can read more here...
http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/11/Integration/episerver-7-5/Indexing/

Also check out the Alloy template example website for implementation example. For images you can insert your image type you want to exclude from index in below like

//using EPiServer.Find.Cms.Conventions;
 
ContentIndexer.Instance.Conventions
  .ForInstancesOf<ImageData>()
  .ShouldIndex(x => false);
#148136
Edited, May 04, 2016 12:06
Vote:
 

Hi,

Thanks for your reply. This works fine. 

#148148
May 04, 2016 19:03
Vote:
 

So what is the way to make Find not index ContentAssesFolders/image files?

#170801
Oct 31, 2016 9:25
Vote:
 

You can use the same method like above but insert your image type instead (ImageData or similar). That will tell Episerver Find not to index those. You might have to trigger the scheduled job to remove the images that were already indexed btw...

#170807
Oct 31, 2016 10:31
Vote:
 

@Aziz: If you want to exclude special folder from being index you can go:

ContentIndexer.Instance.Conventions.ForInstancesOf<IContent>().ShouldIndex(x => !x.ParentLink.Equals(siteSettings.contentAssetFolderToIgnoreContentReference));

siteSetting could be start page of each site!

#170808
Oct 31, 2016 10:35
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.