I want to check SPWeb reference if it is a search site. How can i do this by code.
Thank you
If myWeb.Template
property is one the following, this is a search site :
FYI, this list is computed by using this Powershell command :
Get-SPWebTemplate | ? { $_.description -match "search"}
You have to take into consideration that a "search" site is only a web site where the related web parts are put on pages. A search site can be customized to remove the search, and an another kind of web can add the web parts to be able to search
site.WebTemplate == "SRCHCENTERLITE" ||
site.WebTemplate == "SRCHCEN" ||
site.WebTemplate == "SRCHCENTERFAST"
Where site is a SPWeb should get you all the OOTB search templates (as a conditional of course). I used this code in a site branding project to set my custom search master page instead of the other custom master page.