Result Suggestions Using the Coveo for Sitecore Legacy Search UI Framework
Result Suggestions Using the Coveo for Sitecore Legacy Search UI Framework
Coveo for Sitecore 4.1 (November 2018)
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 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)
Prerequisites
- 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).
Instructions
-
Locate the element with the
CoveoSearchInterface
class in theascx
file (Web Forms) or thecshtml
file (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)
Prerequisites
- You need to use the
Coveo Search Resources
component (Web Forms) or theCoveo Search View Resources
component (MVC), not theCoveo Search Box Resources
component (Web Forms) or theCoveo Search Box View Resources
component (MVC).
Instructions
-
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 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.
The Coveo Omnibox Result List will display search results as the user types. It’s, in fact, a result list that renders itself inside the Coveo JavaScript Search Framework Omnibox.
It’s possible to edit the properties of this component to fit your needs (see Omnibox Result List Component Properties).