Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
It's easier if you reuse one of the property names of ISearchContent:
https://world.episerver.com/documentation/class-library/?documentId=find/8/15648C26
If I understand your question you could just add a SearchTitle property that returns this.Position.
Then you can also inspect the index and see what's there.
Hi Johan,
I am doing following way
First I am removing existing field which was added in EPiServer.Find.Cms.CmsClientConventions
SearchClient.Instance.Conventions.ForInstancesOf<IContent>() .ExcludeField(p => p.SearchSection());
and then I have added my own function as extension method for individual class
public static string SearchSection(this PlayerPage content) { return content.Position; }
and then added in unified registry
SearchClient.Instance.Conventions.ForInstancesOf<PlayerPage>() .IncludeField(p => p.SearchSection());
but the questions is if the below feature does not work then why it is ther?
SearchClient.Instance.Conventions.UnifiedSearchRegistry .ForInstanceOf().ProjectTitleFrom(s => s.Position);
Hi, I am trying to customize the index projection for unified search like below
But i have noticed after several days of debugging that below code in EPiServer.Find.Cms.CmsClientConventions
client.Conventions.ForInstancesOf().IncludeField((Expression>) (x => x.ContentLink)).IncludeField((Expression>) (x => x.GetTimestamp())).IncludeField((Expression>) (x => x.SiteId())).IncludeField((Expression>) (x => x.ContentTypeName())).IncludeField((Expression>) (x => x.Ancestors())).IncludeField>((Expression>>) (x => x.PublishedInLanguage())).IncludeField((Expression>) (x => x.CommonName())).IncludeField((Expression>) (x => x.CommonType())).IncludeField((Expression>) (x => x.CommonTypeShortName())).IncludeField((Expression>) (x => x.CommonTypeDisplayName())).IncludeField((Expression>) (x => x.SearchTitle())).IncludeField((Expression>) (x => x.SearchText())).IncludeField((Expression>) (x => x.SearchSection())).IncludeField((Expression>) (x => x.SearchSubsection())).IncludeField((Expression>) (x => x.HasTemplate())).IdIs((Func) (x => (DocumentId) x.GetIndexId())).ExcludeField("__interceptors").ExcludeFieldMatching((Func) (prop => typeof (XForm).IsAssignableFrom(prop.PropertyType))).ExcludeFieldMatching((Func) (prop => typeof (PageType).IsAssignableFrom(prop.PropertyType))).ExcludeFieldMatching((Func) (prop => typeof (Url).IsAssignableFrom(prop.PropertyType))).ExcludeFieldMatching((Func) (prop => typeof (LinkItemCollection).IsAssignableFrom(prop.PropertyType)));
always takes the precedence. I think the only way to override the SearchTitle/SearchSection is to provide the extension method not through the unified registry?
Any comments regarding this?