Try our conversational search powered by Generative AI!

How to implement Facets with UnifiedSearch?


Hello everyone, 

looking for the help/suggestions/points in my adventure of making UnifiedSearch to work with Facets.

What I have:

  • I have created a page type 'MyCategory'. An instance of this page type can be created and later the users can construct the category tree under the folder 'Categories'.
  • I have a property of type  public virtual IList<>ContentReference> TaxonomyCategories { getset; } defined for my BaseContentPage.

the user can point and populate that property from the Category tree folder, so a page will have some references to some categories for the search purposes.

Now, the questions are:

  • how do I index my pages with that property of list of Categories, do I have to do anything special for it?
  • how do I construct the UnifiedSearchFor call so the facets are also returned based on that property of Categories?

I am looking at the doc and see that there is a common interface, ISearchContent, for declaring properties to use when building search (not querying) functionality. 

As far as I understand in order to use one of properties have to have the property for my page type name EXACTLY as those from the interface:

public virtual string SearchTitle { get { return Heading; } } - for instance.
Later on i can use it as 'search = search.TermsFacetFor(x => x.SearchTitle);' if I want to have the facet based on the Heading.

The field that I would like have the facet is of type List. How do I define the facet on that type?

I see that many people using 'search = search.TermsFacetFor(x => x.SearchSection);' There is also 'SearchSubsection' exists..
Can someone expain what is the property 'SearchSection' and 'SearchSubsection' and if this is what I should use for my case to build the facets?

I guess I could use search.TermsFacetFor(x => x.SearchCategories); - which will return the facets based on build in property 'Category'. Haven't tried that but i
would like to have the end users work on one screen and manupulate my own categories (add/remove from the tree). so that is out of question for now.

so, i guess for one post there are enough questions.. Thank you for the help.


P.S. any links to the discussions related to the questions are very much appreciated. Thanks!
Why would I use UnifiedSearch vs Search? another question.. :)

Oct 29, 2018 21:23
* 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.