Script SharePoint Crawl Rules

I want to exclude certain pages from MOSS indexing, like the confirmation page, which is in the pages library at the root of my site: http: //server/Pages/ConfirmSignup.aspx

I can do this by going to admin search / search results and add url to remove urls.

Since I have dev, staging, uat, production environments, I want to script this. I could only find the command in stsadm Gary Lapointe commands, but this adds an exception to the search scope, which doesn't seem to work for individual files, only for folders. Since there are other files in my / Pages library, I cannot use that.

How do I add a URL to remove search results programmatically?

+2


source to share


1 answer


The SPList object has a NoCrawl property . Setting this value to true ensures that no items in the list are indexed or appear in search results.

Unfortunately, this doesn't go down to the SPListItem level. You will need to have an "Admin" site and exclude its list of pages from indexing.



The advantage of this solution is its level of control. In some cases, the crawl rules are very complex or impossible to define correctly in the search configuration. This option avoids these problems.

+1


source







All Articles