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

Map custom field to excerpt

ZZ
ZZ
Vote:
 

I'm working on Find 15.0.0, CMS 12.23.0

We have a search page on our website that uses unified search. For a particular page I want to map excerpt to a particular field of that page.

I tried with below code, but now its taking first line of another field (body)

SearchClient.Instance.Conventions.UnifiedSearchRegistry.ForInstanceOf<NewsPage>()
                .ProjectExcerptUsing<NewsPage>(page => x => x.Manchet.ToString())
                .ProjectMetaDataFrom(page => new Dictionary<string, IndexValue>
                {
                    { MetadataPropsNames.ImageUrl, page.Image.GetFriendlyUrl() },
            });
#315812
Jan 18, 2024 14:13
* 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.