Try our conversational search powered by Generative AI!

Using Geta Epi Categories for Unified Search (Find


We are using the Geta Epi Categories in out solution We are using version 1.2.1.

Is there a way to use the Geta Epi Categories in the unified search method. The CMS users will be assigning categories to content with the Geta Categories property type (IList). The Unified Search Search Categories property is of the IEnumerable type so was wondering if this is possible and a nudge in the right direction to do this

Thanks in advance!

Jun 06, 2018 16:55

Hi Steven

You can add the categories property to your indexed object(s) as follows:

public class AddGetaCategoriesInitialization : IInitializableModule
    private static readonly ILogger Logger = LogManager.GetLogger();

    private bool _initialized;

    public void Initialize(InitializationEngine context)
        if (_initialized || context.HostType != HostType.WebApplication)

        SearchClient.Instance.Conventions.ForInstancesOf<PageTypeWithGetaCategories>().IncludeField(x => x.GetaCategories());
        _initialized = true;

    public void Uninitialize(InitializationEngine context) { }

Then use the extension method as following:

public static List<string> GetaCategories(this object content)
    if (content is PageTypeWithGetaCategories page)
        return ConvertToList(page.GetaCategoriesPropertyName);
    return new List<string>();

Then facet as usual using .TermsFacetFor(x => x.GetaCategories()) and query using  query = query.FilterHits(x => x.GetaCategories().Match(categorySearchTerm);


Edited, Jun 06, 2018 23:33
<p>Thanks, David I shall have a look at this today and see how it goes!</p>
Jun 13, 2018 9:35
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.