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.
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
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).
The Sitecore Instance Filter rendering is an Allowed Control in the following placeholder(s):
The Coveo for Sitecore SXA Sitecore Instance Filter rendering is meant to be inserted in specific placeholders (i.e.,
Data Source Options
|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