Sitecore Instance Filter
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.
-
Coveo for Sitecore (October 30, 2020) The Sitecore Instance Filter rendering is now added automatically with the Coveo Recommendations and Coveo Related Query renderings.
Insertion Location
The Sitecore Instance Filter rendering is an Allowed Control in the following placeholder(s): Recommendations Components
, Searchbox Components
Example insertion sequence for the Sitecore Instance Filter rendering.
The Coveo for Sitecore SXA Sitecore Instance Filter rendering is meant to be inserted in specific placeholders (i.e., Recommendations Components
, Searchbox Components
).
Example insertion sequence for the Sitecore Instance Filter rendering.
Data Source Options
Option name | Description |
---|---|
Coveo for Sitecore (October 30, 2020)Filter results based on the current Sitecore context database | Defines whether to include a filter such that only items from the current Sitecore context database will be included in query results/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/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/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:
