Skip to content

Commit 7b71db8

Browse files
authored
Merge pull request MicrosoftDocs#622 from tseward/patch-308
Update Set-SPEnterpriseSearchResultItemType.md
2 parents d8dc96c + 996ffdc commit 7b71db8

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

sharepoint/sharepoint-ps/sharepoint-server/Set-SPEnterpriseSearchResultItemType.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,20 @@ For permissions and the most current information about Windows PowerShell for Sh
4545

4646
### --------------------EXAMPLE---------------------
4747
```
48-
C:\PS>$web = Get-SPWeb "UrlOfTheSite"
49-
$tenantOwner = Get-SPEnterpriseSearchOwner -Level SPSite -SPWeb $web
50-
$searchapp = Get-SPEnterpriseSearchServiceApplication
51-
$resultType = Get-SPEnterpriseSearchResultItemType -Owner $tenantOwner -SearchApplication $searchapp
52-
$resultType.BuiltIn
53-
54-
$rule = Get-SPEnterpriseSearchPropertyRule -PropertyName "ContentTypeId" -Operator "StartsWith"
55-
$rule.AddValue( "0x010063C2F478ACC511DFB869B5BFDFD720851252" )
56-
57-
$ruleCollection = Get-SPEnterpriseSearchPropertyRuleCollection
58-
$ruleCollection.Add( $rule )
59-
60-
$displayProperties = "WorkId,Rank,Title,Size,Path,Description,SiteName,HitHighlightedSummary,HitHighlightedProperties,ViewsLifeTime"
61-
62-
$displaytemplateUrl = "~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_MyCustomDisplayTemplate.js"
63-
64-
Set-SPEnterpriseSearchResultItemType
48+
PS C:\>$web = Get-SPWeb http://webUrl
49+
PS C:\>$tenantOwner = Get-SPEnterpriseSearchOwner -Level SPSite -SPWeb $web
50+
PS C:\>$ssa = Get-SPEnterpriseSearchServiceApplication
51+
PS C:\>$resultType = Get-SPEnterpriseSearchResultItemType -Owner $tenantOwner -SearchApplication $ssa
52+
PS C:\>$resultType.BuiltIn
53+
PS C:\>$rule = Get-SPEnterpriseSearchPropertyRule -PropertyName "ContentTypeId" -Operator "StartsWith"
54+
PS C:\>$rule.AddValue('0x010063C2F478ACC511DFB869B5BFDFD720851252')
55+
PS C:\>$ruleCollection = Get-SPEnterpriseSearchPropertyRuleCollection
56+
PS C:\>$ruleCollection.Add($rule)
57+
PS C:\>$displayProperties = "WorkId,Rank,Title,Size,Path,Description,SiteName,HitHighlightedSummary,HitHighlightedProperties,ViewsLifeTime"
58+
PS C:\>$displaytemplateUrl = "~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_MyCustomDisplayTemplate.js"
59+
PS C:\>Set-SPEnterpriseSearchResultItemType
6560
-Identity $resultType `
66-
-SearchApplication $searchapp `
61+
-SearchApplication $ssa `
6762
-Name "CustomResultType" `
6863
-Rules $ruleCollection `
6964
-RulePriority 1

0 commit comments

Comments
 (0)