Style the Search Experience

Legacy feature

This article pertains to the Coveo Hive framework which is now in maintenance mode.

Choose one of Coveo’s more modern, lightweight, and responsive libraries for any future search interface development. See the search interface Implementation guide for more details.

Improving the search experience can be done by modifying information that a Coveo Hive search interface returns and enhancing the way that information is presented.

Result Templates

Your initial functional search interface might well make use of the default.cshtml result template view file. This view file renders generic field data that, most likely, is of little value to your users. Additionally, until you perform the necessary steps, all your search results display these generic fields, regardless of the type of Sitecore item the result relates to.

To make your search result details more relevant, you should now create your own result template view files and reference them in Coveo result template components. To achieve this goal, you need to know how to embed Coveo result template components in Coveo results list components and ensure that the appropriate result template is rendered, based on conditions you want to specify (see Create and Make Use of a New Result Template).

Next, you want to choose the fields that are displayed in the result templates, show some fields under some conditions, and automatically display field labels in the user native language (see Edit the Content of a Result Template).

You can add tabs to your search interface. Tabs are often used to add a specific filter expression, effectively zeroing in on a subset of your indexed documents. In this scenario, it may make sense to display a certain facet or result template when the user is on one tab, but not when on another. Coveo for Sitecore components support this use case (see Manage Components on a Per-Tab Basis).

Custom Styling

You might also find your initial search interface bland, or not in line with your corporate branding. Therefore, you probably want to override the default Coveo for Sitecore CSS with your own (see Insert Custom CSS).

Finally, if a critical error occurs when rendering your search interface, the Coveo Search Interface component displays a generic message. You might want to replace this generic message with one that instructs your users on how to report the issue (see Override the Search Friendly Error Message).