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

Problem with projections for a UnifiedSearch in UnifiedSearchRegistry

Vote:
 

Hi

I want to do a UnifiedSearchFor() and for all types that implement "IHaveImage" I want to project the image url to the UnifiedSearchHit.ImageUri.

Currently I am doing this in my InitilizableModule:

SearchClient.Instance.Conventions.UnifiedSearchRegistry
.ForInstanceOf()
.CustomizeProjection(
x => x.ProjectImageUriFrom(
page => new Uri("http://www.test.com"))); // this is just for test, otherwise it would be something like this: new Uri(page.Image.Url)

But it doesn't seem to be indexed. Am I doing something wrong? Is this the right way to add a image to a generic search result?

I am using the EPiServer Find v8.7.0.1103 and EPiServer v7.14.2.0.

Thanks in advance!

/Fred

#112455
Oct 28, 2014 14:35
Vote:
 

I got it to work with this:

SearchClient.Instance.Conventions.UnifiedSearchRegistry
.ForInstanceOf<IHaveImage>()
.ProjectImageUriFrom(x => new Uri("http://www.testprojection.com"));


/Fred

#112495
Oct 29, 2014 9:57
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.