volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Rendering facets

How on the view do we render a facet?

#193662
Jun 01, 2018 19:04

Hi Rob

You need to request the facets then extract them from the search results as shown below:

var tagCounts = searchResults
    .TermsFacetFor(x => x.Tags).Terms;
foreach(var tagCount in tagCounts)
{
    string tag = tagCount.Term;
    int count = tagCount.Count;
    Console.WriteLine(tag + ": " + count);
}

Please note this is extracted from the officual Find documentation here:

https://world.episerver.com/documentation/developer-guides/find/NET-Client-API/searching/Facets/Terms-facets/

David

#193681
Jun 02, 2018 23:13

Thanks for that!

#193690
Jun 04, 2018 6:53
* 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.