Research & Development for 3D & the Web

Excluding Sitecore items from Search Results

by on Jan.27, 2012, under Sitecore

Excluding Sitecore items from your search results in Sitecore using Lucene

Lets say you want to exclude a particular item from being displayed in your search results when searching in your Sitecore site. This can be done by adding a couple of lines to your web.config file.

Do a search for:

“Sitecore.Search.Crawlers.DatabaseCrawler, Sitecore.Kernel”

It’s possible to add templates or IDs of  items of which should be included to the index or excluded from it. Lets say you want to exclude all items with a particular template, you would reference that ID in the tags. You may need to clear Sitecore cache and re-build the index through Sitecore Control Panel (but not sure on that).
Example:
<include hint=”list:IncludeTemplate”>

<sampleItem>{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}</sampleItem>

</include>
<exclude hint=”list:ExcludeTemplate”>

<layout>{3A45A723-64EE-4919-9D41-02FD40FD1466}</layout>

</exclude>

 

A good reference for this is on this site:

:index, Lucene, searching, Sitecore

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...

Log In