The Global LINQ Filters allow the creation of filters that will be applied to every query that is executed through the LINQ layer. This can be used to globally limit search results based on security or templates
To define a Global LINQ Filter, follow these steps:
Create a new class that inherits from the
Sitecore.ContentSearch.Pipelines.QueryGlobalFilters.ApplyGlobalLinqFiltersclass. Override the
GetQueryvirtual method and apply your custom logic, as shown in the following code sample:
Coveo.SearchProvider.configconfiguration file and add the following lines in the
Open LinqScratchPad (typically located under
http://SitecoreInstanceName/sitecore/admin/LinqScratchPad.aspx) in your browser and execute a query to validate that the Global LINQ filter is working as expected.