In this blog post I will discuss what you need to do to get cross-site collection publishing to work in SharePoint 2016. The Cross-Site Collection Publishing feature was introduced in SharePoint Server 2013 and allows you to use one or more authoring site collections to author and store content, and one or more publishing site collections to control the design of the site and to show the content. The authoring site collection contains so-called catalogs, which are lists that contain content, tagged with metadata (by means of site columns). These catalogs are indexed by the search system and made available to the publishing site collection. The publishing site collection issues queries for data that has been indexed and shows it on web pages by using Search Web Parts, like the Content Search WebPart. You brand content on the publishing site by using master pages, page layouts, and display templates.
In SharePoint 2013, cross-site collection publishing used to work out-of-the box. In SharePoint 2016, when integrating the catalog in a publishing site. No results are shown by the content search webpart that is added to the category page.
Although, in the properties of the webpart you will notice that the items from your catalog are in the search index. The webpart is not showing any items because it is additionally filtering the taxonomy managed property on the current and child navigation.
The reason that he is not showing any results in the content search webpart is caused by what I described in a previous blog post on auto generated managed properties in SharePoint 2016. Because they are not “activated” by default anymore, you have to create/activate them manually.
You can fix this taxonomy managed property in the search schema of the search service application using the following PowerShell.
1 2 3 4 5 6 7 8 9 10 11 |
$ssa = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application" $category = Get-SPEnterpriseSearchMetadataCategory -SearchApplication $ssa -Identity "SharePoint" $crawledProperty = New-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $ssa -Category $category -VariantType 0 -PropSet "158d7563-aeff-4dbf-bf16-4a1445f0366c" -Name "ows_taxId_Genre" -IsNameEnum $false $managedProperty = New-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $ssa -Name "owstaxIdGenre" -Type 1 -FullTextQueriable $true -Queryable $true -Retrievable $true -SafeForAnonymous $true $managedProperty.Searchable = $true $managedProperty.Refinable = $false $managedProperty.Sortable = $false $managedProperty.HasMultipleValues = $true $managedProperty.OverrideValueOfHasMultipleValues = $true $managedProperty.Update() $mapping = New-SPEnterpriseSearchMetadataMapping -SearchApplication $ssa -ManagedProperty $managedproperty -CrawledProperty $crawledproperty |
The PropSet ID will be “158d7563-aeff-4dbf-bf16-4a1445f0366c” since the cross-site collection category/navigation field is always a taxonomy field. To find the appropriate name for the crawled and managed property, you can search for them in the Search Schema of the Search Service Application using Central Administration. You can’t decide to rename this field because the cross-site collection configuration will be looking for this exact field. Other fields, part of your catalog, can be created with different names and used in the property mappings of the Content Search WebPart without any problem.
Don’t forget to start the crawler after having updated the crawled and/or managed properties.
No comments:
Post a Comment