Result Suggestions Using the Coveo for Sitecore Legacy Search UI Framework
Result Suggestions will send a query after every keystroke. Hence, it’s the most demanding feature in terms of query consumption.
Search results can be displayed as the user types in the Coveo Search Box. To simplify the configuration of those search results, Coveo provides components that can be added to search boxes.
This component suggests results directly in the Omnibox. Clicking on one of the suggestions directly opens the item.
You can add this component to both the full search interface and the standalone search box.
Search Interface (Coveo Search/Coveo Search View)
- A copy of the default Coveo Search component (see Duplicating the Coveo Search Component).
- The Omnibox must be enabled on your page (see Search Component Properties).
Locate the element with the
CoveoSearchInterfaceclass in the
ascxfile (Web Forms) or the
cshtmlfile (MVC) of your Coveo Search component copy.
Add the following element anywhere between the opening
<div>tag and the closing
</div>tag of that element:
<div class="CoveoOmniboxResultList"> <script class="result-template" type="text/x-underscore-template"> <div> <a href="" class="title open-link"></a> </div> </script> </div>
Save the file.
Standalone Search Box (Coveo Search Box/Coveo Search Box View)
- You need to use the
Coveo Search Resourcescomponent (Web Forms) or the
Coveo Search View Resourcescomponent (MVC), not the
Coveo Search Box Resourcescomponent (Web Forms) or the
Coveo Search Box View Resourcescomponent (MVC).
In the Experience Editor in Edit mode, once a Coveo Search Box component has been added to your page, you should see a Sitecore placeholder located under the search box.
Click on Add components.
Click Add here.
Select the CoveoOmnibox Result List component.
Save the item.
After adding a Coveo Omnibox Result List to your Coveo Search Box, the name of the component should appear under the search box. This name is only visible in edit mode.
It’s possible to edit the properties of this component to fit your needs (see Omnibox Result List Component Properties).