How about adding a convention to not index them at all? If you don't to search for them at all on site, that's the best solution...
Nah, normally you don't need to index images so might as well save some space in index. I normally remove them at least...
Another idea is to divide the images and keep all the website framework images (like logo etc) in a special folder and avoid indexing only that if you want to keep support for search general content images on your website.
For example, if I want to get rid of .svg files, but the folling not work. I did manual reindex.
ContentIndexer.Instance.Conventions .ForInstancesOf<ImageData>() .ShouldIndex(x => false);
Kan fungerar med att filtera bort .svg i initializeringen i det här fallet också:
var notAcceptedFileExtensions = new List<string>() {"svg"};
...
ContentIndexer.Instance.Conventions.ForInstancesOf<IContentMedia>().ShouldIndex(x =>
{
if (notAcceptedFileExtensions.Contains(x.SearchFileExtension().ToLowerInvariant()))
{
return false;
}
var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();
I would recommend to look more into my blogpost here:
http://world.episerver.com/blogs/Henrik-Fransas/Dates/2014/3/Indexing-only-referenced-files-with-EPiServer-Find-75/
Hi,
How to get rid of the pics from the WPi-find results list?