Set up the Interface
- Understanding the Search Hub
- Integrate a Hosted Search Page in a Sitecore Item
- Insert an Example Search Page
- Data Source Branch Templates
- Search Page Structure
- Add and Preview the Search Resources
- Use SXA Components in the Experience Editor
- Add Basic Controls
- Insert and Configure a Global Search Box
Understanding the Search Hub
The search hub is a key Coveo concept. Most topics pertaining to the search hub will only be tackled later, in the Achieve Relevance section. However, the goals of this article are to bring awareness to the importance of setting custom search hub values while building your search solution and to show you where to do so in your Coveo for Sitecore rendering data sources.
Search Hub Basics
Coveo for Sitecore tags a call to the search API and its associated usage analytics event with a reference to the search interface the query originates from. That tag is called the search hub.
In usage analytics event calls, the search hub value appears in the
In a Coveo for Sitecore search interface, you have set the
Search Hub value to
phone in the search box and run the query.
The browser developer tools show two calls: the search API call and the call to Coveo Usage Analytics.
The search call shows the following headers:
The usage analytics call shows the following headers:
Search Hub Uses
The search hub value is a critical piece of information for search consumption tracking, analytics reporting, in feeding Coveo Machine Learning (Coveo ML) models, and gaining relevance from these models.
Monitoring Search Consumption
Your Coveo Platform license defines a limit on the monthly number of Search API calls for your organization. Performing a keyword search counts against this quota, but other user actions also trigger Search API calls (see Query Types). Moreover, calls to the Search API can originate from various locations in your search solution, and even from the Coveo Administration Console. Your organization Consumption Dashboard lets you monitor query usage on a per search hub basis.
Content and search managers want to monitor the effectiveness of each of their search interfaces using metrics based on calls to Coveo Usage Analytics. In turn, they can use the insights derived from these metrics to carry out changes to their search interfaces, their query pipelines, or to the indexed content (see the articles in the Leverage Coveo Usage Analytics Coveo Cloud documentation section).
The Analytics section of the Coveo Administration Console navigation menu contains a wide array of reports and graphics, many of which you can filter on a search hub basis.
To get good analytics metrics, you need large amounts of good data. This is achieved by setting your search hub values early and properly.
Machine Learning Driven Features
Typical Coveo-powered search solutions include multiple search interfaces that may be used by different audiences and for different purposes. For example, a Coveo search solution may contain the following search interfaces:
a customer-facing community search page
an internal support agent insight panel
Since audience and audience intent differ on these two types of search interfaces, a given query shouldn’t yield the exact same results (and in the same order) on both. Indeed, when you properly set up your search solution to use Coveo Machine Learning, a model associated with the community search page will gather user behavior analytics far different from the ones gathered by a model associated with the support agent insight panel. That’s why Coveo separates ML models and submodels based on the search hub value (see Sub-Models).
Whether for Automatic Relevance Tuning (ART), Query Suggestions (QS), or Dynamic Navigation Experience (DNE), the effectiveness of a Coveo ML model driven feature depends on the amount and quality of usage analytics data gathered, and that begins with properly setting your search hub values (see Leverage Machine Learning).
Setting the Search Hub
By default, when you don’t specify a
Search Hub value, Coveo for Sitecore sets a default value.
When you insert the Coveo for Sitecore Analytics rendering in a Coveo Search Interface and don’t specify a value in the Coveo for Sitecore Analytics data source
Search Hubfield, Coveo for Sitecore sets the
Search Hubto the name of the search page item.
When you insert the Coveo Global Searchbox rendering in an article header and don’t specify a value in the Coveo Global Searchbox data source
Override search hubfield, Coveo for Sitecore sets the
Search Hubvalue used for the global search box query suggestion calls to the name of the search page item the global search box redirects its queries to.
Hence, specifying custom search hub values in some data source fields and leaving some others blank breaks the analytics-search search hub matches you need to fully leverage machine learning.
Specify custom search hub values in all data sources which contain search hub value fields to ensure meaningful search hub names and analytics-search search hub matches.
Setting the Search Hub In a Multi-Rendering Coveo for Sitecore Search Page
Whether you build a Coveo for Sitecore search page one rendering at a time or fast-track your way to a multi-rendering search page by inserting an Example Search Page, you need to insert the Coveo for Sitecore Analytics rendering in your Sitecore search page item.
You set the
Search Hub value in the Coveo for Sitecore Analytics data source.
Setting the Search Hub In a Coveo Hosted Search Page
Coveo for Sitecore supports integrating a Coveo Platform search page in a Sitecore item through the Example Hosted Search Page branch template.
When you insert a branch from this template, a data source item is added as the deepest child of the branch.
This data source contains the
Search Hub field.
Setting the Search Hub In a Global Search Box
You may want to insert a Coveo Global Searchbox rendering in your website article headers and have this global search box provide query suggestions as the user types.
Override search hub value in the Coveo Global Searchbox data source to match the search hub value of the search interface whose query suggestions you want to use.
Setting the Search Hub When Using Server-Side Code to Call the Search API
Surfacing index data using direct server-side calls to the Search API should be done parsimoniously. This method not only involves writing code but it also doesn’t log usage analytics search events.
If you’re going to use this approach, you should tag your searches using the
SearchHub property of the
QueryParams class, as illustrated in the Calling the Coveo Search API Using Server-Side Code code sample.
This lets you either leverage machine learning acquired by the model associated with the given search hub or track your search consumption on a dedicated search hub name.