If you’ve been reading this series of articles – you know we’ve been talking about search service architecture and how to create an assembly that will trim your search results depending on custom conditions. Now is the time to talk about deploying our custom trimmer.
I assume you have already dropped trimmer assembly to GAC and performed IISRESET.
1. Navigate to your central administration Services on Server page:
http://[central admin]/_admin/Server.aspx
2. Ensure Search Query and Site Settings Service is running.
3. Register your new assembly as a trimmer using the following PowerShell command:
New-SPEnterpriseSearchSecurityTrimmer -SearchApplication"Search Service Application"-TypeName "CustomSearchTrimmer.MyCustomTrimmer,CustomSearchTrimmer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"-RulePath file://myservername/* -id 102
Here, SearchApplication is the name of the search service application which you can find from here:
http://[central admin]/_admin/ServiceApplications.aspx
TypeName is your assembly information which you can extract from GAC. RulePath is the crawl rule associated with your trimmer. ID identifies trimmer instance.
Here is more comprehensive reference of all of the parameters this command accepts.
There you can also find how you can remove and view the details of the trimmer by using PowerShell commands:
Remove-SPEnterpriseSearchSecurityTrimmer
Get-SPEnterpriseSearchSecurityTrimmer
Good Luck!