Sitecore Instance Filter
Sitecore Instance Filter
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. |
Implements the CoveoForSitecoreLocalExpression component which adds filters for the current Sitecore instance to the constant query expression (cq
) of Search API calls.
It registers a handler in the onSitecoreContextInitialization
event triggered by the CoveoForSitecoreExpressions component.
The new Filter results based on the current Sitecore context database
option lets you control whether to add a filter on the current Sitecore context database in the cq
.
Prior to the October 30, 2020 release, search results and recommendations were automatically filtered on the current Sitecore context database using a source==<SITECORE_SOURCE_NAME>
filter in the advanced query expression (aq
).
Usage notes
-
The Sitecore Instance Filter rendering is added automatically with the Coveo Search Interface rendering.
-
The Sitecore Instance Filter rendering is now added automatically with the Coveo Recommendations and Coveo Related Query renderings.
Insertion location
Coveo Hive
The Sitecore Instance Filter rendering is an Allowed Control in the following placeholder(s): Recommendations Components
, Searchbox Components
Coveo Hive SXA
The Coveo for Sitecore SXA Sitecore Instance Filter rendering is meant to be inserted in specific placeholders (that is, Recommendations Components
, Searchbox Components
).
Data source options
The following table lists the available data source options for this rendering.
Option name | Description |
---|---|
Defines whether to include a filter such that only items from the current Sitecore context database will be included in query results or recommendations. Disabling this option automatically disables the other Sitecore-specific filters below. |
|
Filter Sitecore results on the current context language |
Defines whether to include only Sitecore items in the current context language in query results or recommendations. |
Filter Sitecore results on the latest version |
Defines whether to include only the latest version of Sitecore items in each language in query results or recommendations. |
Sample Generated HTML and Corresponding Results
<div class="CoveoForSitecoreLocalExpression"
data-sc-filter-on-sitecore-context-database="true"
data-sc-filter-on-current-language="false"
data-sc-filter-on-latest-version="true">
</div>
Search API call cq
:
Query Results: