We are using Episerver find to index our site (using our own type ISearchableContent) along with an external connector to crawl another site for new articles.
We then use TermsFacetFor to build a list of types that we use as filters available in our search result screen.
// Code Shortened for example var search = searchClient.UnifiedSearch(Language.English); search = search.TermsFacetFor(x => x.SearchSection); search = search.Filter(x => x.MatchTypeHierarchy(typeof(ISearchableContent)) | x.MatchType(typeof(WebContent))); var unifiedResults = search.GetResult(new HitSpecification { HighlightExcerpt = true, EncodeExcerpt = false }, searchDefinition.FilterForVisitor); var contentLabelFacets = unifiedResults.TermsFacetFor(x => x.SearchSection);
The issue we have is the WebCotent doesnt appear to implement all of the properties of ISearchContent, namely SearchSection which we are using for our Facets.
Any idea how we use could specify a common field for facets in both types of content? All of the fields in WebContent seem unsuitable.
Couple of Ideas I had were
- somehow force all the WebContent to have a set value for SearchSection?
- maybe use SearchSourceName in WebContent and add that to ISearchableContent but that would require the index to have a specific name which doesnt seem ideal.
Ben