Episerver Find UnifiedSearch


Hi i am using UnifiedSearch, i used a Interface to define the Search and i want to returns the records with a image.

if i remove  CustomizeProjection it works, but i want to return the image also

The problem that i have is in line that get the results, it throwing a Exception 

Message"An error has occurred."
ExceptionMessage"Object reference not set to an instance of an object."
StackTrace" at EPiServer.Find.UnifiedSearch.UnifiedSearchRegistry.GetProjectionForType(Type type) at EPiServer.Find.UnifiedSearch.UnifiedSearchRegistry.GetProjectionForType(Type type) at EPiServer.Find.UnifiedSearch.UnifiedSearchRegistry.GetRules(Type type) at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at 
But i don't have idea what i am doing wrong
var results =

 interface ISearchData     {          string SearchTitle { get;  }          string SearchText { get; }          string SearchSummary { get;  } string SearchHitUrl { get; }
Url SearchImage { get; set; }              }

public class FindInitialization : IInitializableModule
       public void Initialize(EPiServer.Framework.Initialization.InitializationEngine context)
               CustomizeProjection(x => x.ProjectImageUriFrom<>ISearchData>(c => GetPageImage(c.SearchImage)));
       private Uri GetPageImage(EPiServer.Url image)
           if (image != null)
               return image.Uri;
           return null;
Oct 30, 2014 6:32

I think it's easier to implement ISearchContent to your types and do your GetPageImage() in there.

Jan 25, 2015 19:21
* 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.