Thursday, 24 November 2011

Create a complete content source with rule etc.

Get the search application

$searchapp = Get-SPEnterpriseSearchServiceApplication "Search application"

Create the content source

New-SPEnterpriseSearchCrawlContentSource -SearchApplication $searchapp -Type web -name IT -StartAddresses http://it

Add the inclusion rule

New-SPEnterpriseSearchCrawlRule -SearchApplication $searchapp –path http://it/* –CrawlAsHttp 1 -Type InclusionRule

And reduce the hit rate
New-SPEnterpriseSearchSiteHitRule myHost -Behavior 0 -HitRate 40

Ta Daaaaa!

 

Problems

I don;t know why but I never get on with Identity,

New-SPEnterpriseSearchCrawlRule -SearchApplication $searchapp -Identity http://it -CrawlAsHttp 1 -Type InclusionRule

   1: PS C:\Users\alman> New-SPEnterpriseSearchCrawlRule -SearchApplication $searchapp
   2:  -Identity http://it -CrawlAsHttp 1 -Type InclusionRule
   3: New-SPEnterpriseSearchCrawlRule : A parameter cannot be found that matches para
   4: meter name 'Identity'.
   5: At line:1 char:72
   6: + New-SPEnterpriseSearchCrawlRule -SearchApplication $searchapp -Identity <<<<
   7:  http://it -CrawlAsHttp 1 -Type InclusionRule
   8:     + CategoryInfo          : InvalidArgument: (:) [New-SPEnterpriseSearchCraw
   9:    lRule], ParameterBindingException
  10:     + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Office.Server.S
  11:    earch.Cmdlet.NewSearchCrawlRule

found that using the path switch worked better:


New-SPEnterpriseSearchCrawlRule -SearchApplication $searchapp –path http://it/* –CrawlAsHttp 1 -Type InclusionRule

No comments:

Post a Comment