There is no option to delete the default search Content Source in sharepoint so here is a way to manually do it via Visual Studio.
Microsoft.SharePoint.dllMicrosoft.Office.Server.dllMicrosoft.Office.Server.Search.dll Add the following namespacesusing Microsoft.Office.Server.Search.Administration;using Microsoft.Office.Server;using Microsoft.SharePoint; Replace the code with the following.// search service application name string ssaName = "Search Service Application"; SearchContext context = SearchContext.GetContext(ssaName);Content ssaContent = new Content(context); ContentSourceCollection ssaContentSources = ssaContent.ContentSources; ContentSource cs = ssaContentSources["Local SharePoint Sites"]; cs.Delete();
Microsoft.SharePoint.dll
Microsoft.Office.Server.dll
Microsoft.Office.Server.Search.dll
Add the following namespaces
using
Microsoft.Office.Server.Search.Administration;
Microsoft.Office.Server;
Microsoft.SharePoint;
Replace the code with the following.
// search service application name
string
ssaName =
"Search Service Application"
;
SearchContext context = SearchContext.GetContext(ssaName);
Content ssaContent =
new
Content(context);
ContentSourceCollection ssaContentSources = ssaContent.ContentSources;
ContentSource cs = ssaContentSources[
"Local SharePoint Sites"
];
cs.Delete();
Richard Mueller edited Revision 1. Comment: Removed (en-US) from title, modified title casing
Craig Lussier edited Original. Comment: added en-US to tags and title