Skip to end of metadata
Go to start of metadata

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

Icon

Global LINQ Filters are only available starting from Sitecore 7.2 rev. 140228 (initial release) or later.

To define a Global LINQ Filter, follow these steps:

  1. Create a new class that inherits from the Sitecore.ContentSearch.Pipelines.QueryGlobalFilters.ApplyGlobalLinqFilters class. Override the GetQuery virtual method and apply your custom logic, as shown in the following code sample:

  2. Open your Coveo.SearchProvider.config configuration file and add the following lines in the <pipelines> XML element:

  3. 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.