November Happy Hour will be moved to Thursday December 5th.

Exclude pages and page types from search index

Vote:
 

Hi,

I have a question regarding search (not Find) in EPiServer 7. I'm wondering how I can prevent a page (or an entire page type) from beeing indexed. I guess I need to do something in the DocumentAdding event but I can't figure out what. Or is there another way to do it?

#76761
Nov 01, 2013 10:29
Vote:
 

You could add a post search filter that removes certain pages depending an a property value or on page type name. 

Here I do a reording depending on a boolean property: http://world.episerver.com/Blogs/Per-Nergard/Dates/2013/10/Let-editors-set-pages-to-always-be-on-top-in-search-result-SearchDataSource-not-Find/.

You need to rewrite the filter method to fit your need.

Post on creating filters by Frederik Vig: http://www.frederikvig.com/2009/06/episerver-filter-part-2/

 

#76798
Nov 01, 2013 19:20
Vote:
 

Thank you for the links Per, probably should have mentioned that the site I'm building is MVC based.

Anyhow, support pointed out the ISearchable interface for me and I wrote a short summary on how to use it: http://jonas.kihlsten.se/blog/2013/11/episerver-7search-prevent-content-from-being-indexed/

#76876
Nov 05, 2013 13:47
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.