November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Your snippet looks correct and should work as expected (your excerpt should only contain TeserText). I've not been able to recreate the issue. Can you post the exact query you are performing?
Hi,
If you check the EPiServer.Find.UnifiedSearch.HitProjection.GetProjection method, you will see the logic used when getting Excerpt text like below:
Expression expression2 = hitSpecification.HighlightExcerpt ? HitProjection.ReplaceParameter(this.HighlightedExcerptProjection(hitSpecification), newParameter).Body : HitProjection.ReplaceParameter(this.ExcerptProjection(hitSpecification), newParameter).Body;
MemberAssignment memberAssignment2 = Expression.Bind((MemberInfo) typeof (UnifiedSearchHit).GetProperty("Excerpt"), expression2);
So you can choose one of below ways to make your customization works:
SearchClient.Instance.Conventions.UnifiedSearchRegistry
.ForInstanceOf<CorporateContentPage>()
.ProjectExcerptUsing<CorporateContentPage>(spec => x => x.TeaserText);
SearchClient.Instance.Conventions.UnifiedSearchRegistry
.ForInstanceOf<CorporateContentPage>()
.ProjectHighlightedExcerptUsing<CorporateContentPage>(spec => x => x.TeaserText);
Hope it helps :)
Im a little confused about how the HitSpecification chooses which properties to use for building the excerpt text for a result.
I have created a custom projection for the excerpt text from for the pages on my site:
This correctly displays teaser text when available on the page, however it seems when the teaser text is not long enough to fill the ExcerptLength defined on the HitSpecification, it will get text from other properties on the page to makeup the length.
I would like to either: