Try our conversational search powered by Generative AI!

Episerver FIND Unified Search Custom Categories



I would like to use the Unified Search functionality of FIND to filter search results using our own custom categories and our own Published Date fields as Facets, but I cant see how this can be done - I have searched the internet for days and cant find any documentation about this.

I have used the alternative way:

var queryx = client.Search<DocumentFile>()
                .TermsFacetFor(x => x.SubjectTags)
                .TermsFacetFor(x => x.DocumentTags)
                .OrderByDescending(x => x.DatePublished);

    BUt I would ideally like to use the UnifiedSearch method.

Can you help?


Jan 08, 2014 9:49

You can easily index extra information by adding extension methods. Here's an example:

Jan 08, 2014 10:08

Hi, Many thanks. How would you apply this so our facets are derived from a categorylist which is a property of a page.

All the examples we have seen regarding facets always seem to reference the pageName rather than any other type.

Thanks again,


Jan 08, 2014 10:51

On a second thought, I think the easiest approach in this case would be to do the following:

create facets by using the "SearchCategories" property, which is part of the ISearchContent interface(which is used by unified search).

.TermsFacetFor(x => x.SearchCategories);

On your page classes, ArticlePage, SitePageData, etc. create a property named SearchCategories. By doing this you will override what normally would be indexed, which is the standard category property.

        public IEnumerable<string> SearchCategories
                foreach (int category in SomeCategoryProperty)
                    yield return Category.GetCategoryName(category);

 And then run the cms content indexing job.



Jan 08, 2014 11:53


That is great, many thanks. Second question, How would I get a single string such as DatePublished to come back as a Facet?


Jan 08, 2014 12:03

For datetime facets I would recommend using the HistogramFacetFor method

The ISearchContent interface contains a couple of DateTime methods that you could override.

Optionally create an extension which returns a string, as referenced in my first reply, and use TermsFacetFor on that

Jan 08, 2014 12:18

Excellent many thanks

Jan 08, 2014 12:19
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.