Exclude Items Without Layouts From Being Indexed
When indexing your items, you might want to exclude items that don’t have layouts, which can help reduce the total indexing time, and can reduce the size of your index. While you could do so by changing the crawling root of your index (see Change the Crawling Root of an Index), it can become time consuming when your items without layouts aren’t grouped at the same place.
Instead, you can decide to include the
Coveo.SearchProvider.CoveoInboundFilters.HasLayoutInboundFilter processor, which automatically excludes items without layouts from being indexed.
Coveo.SearchProvider.Custom.configfile. It’s usually located under
[Sitecore instance root]\Website\App_Config\Include\Coveo.
coveoInboundFilterPipelinenode. It’s located under
coveoInboundFilterPipelinenode, add the following node:
<!-- Used to exclude items that don't have layouts from being indexed --> <processor type="Coveo.SearchProvider.CoveoInboundFilters.HasLayoutInboundFilter, Coveo.SearchProviderBase"> </processor>
(Optional) Specify a path on which to apply your processor. By default, the processor is applied to all of the Sitecore items.
In your Sitecore instance, you kept the default crawling roots, which crawl items under
/Media Library/Files. You want to prevent items without layouts in the
contentbranch from being indexed, but not in the
/Media Library/Filesone, which usually only contain items without layouts.
In your processor, you add the following
<!-- Used to exclude items that don't have layouts from being indexed --> <processor type="Coveo.SearchProvider.CoveoInboundFilters.HasLayoutInboundFilter, Coveo.SearchProviderBase"> <ApplyToPaths>/sitecore/content</ApplyToPaths> </processor>
Save and close the file.
Rebuild your indexes (see Coveo for Sitecore Indexing Guide).