sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Search not indexing property bag values on modern sites in O365

Open camoire opened this issue 8 years ago • 4 comments

Category

  • [x] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

In modern sites, web property bag values that have been added to the vti_indexedpropertykeys are properly indexed and their corresponding crawled properties are created.

Observed Behavior

Property bag keys that have been flagged for indexing do not show up as a crawled properties

Steps to Reproduce

Create a modern team site using the following script and wait for the custom property bag value to get crawled.

$tenantAdminUrl = <tenant_admin_url> $newSiteTitle = <new_site_title> $newSiteAlias = <new_site_alias> ## no spaces $propertyBagKey = <new_property_key> $propertyBagValue = <new_property_value>

Connect-PnPOnline -Url $tenantAdminUrl $newSiteUrl = New-PnPSite -Type TeamSite -Title $newSiteTitle -Alias $newSiteAlias

$site = Get-PnPTenantSite -Url $newSiteUrl if ($site.DenyAddAndCustomizePages -ne "Disabled") { Write-Host "Disabling customize pages" $site.DenyAddAndCustomizePages = "Disabled" $updateResult = $site.Update() $site.Context.ExecuteQuery() }

Connect-PnPOnline -Url $newSiteUrl Set-PnPPropertyBagValue -Key $key -Value $value -Indexed

$customizeValue = Get-PnPTenantSite -Url $newSiteUrl | select DenyAddAndCustomizePages $newKeyValue = Get-PnPPropertyBag -Key $key $encodedValue = Get-PnPPropertyBag -Key "vti_indexedpropertykeys" $trimmedEncodedValue = $encodedValue.Substring(0, $encodedValue.Length - 1) $unencodedValue = [System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($trimmedEncodedValue)) Write-Host "Site URL - " (Get-PnPSite).Url Write-Host "DenyAddAndCustomizePages - $($customizeValue.DenyAddAndCustomizePages)" Write-Host "New Key Value - $newKeyValue" Write-Host "Encoded Indexed Property Keys Value - $encodedValue" Write-Host "Unencoded Indexed Property Keys Value - $unencodedValue"

$site = Get-PnPTenantSite -Url $newSiteUrl if ($site.DenyAddAndCustomizePages -ne "Enabled") { Write-Host "Enabling customize pages" $site.DenyAddAndCustomizePages = "Enabled" $updateResult = $site.Update() $site.Context.ExecuteQuery() }

camoire avatar Jan 03 '18 17:01 camoire

Any updates for this issue? I try to query the "_PnP_ProvisioningTemplateId" property. In a tenant this property will indexed and in another tenant not. I did't the following step:

$salesProject1 = New-PnPSite -Title "Sales  Project 1" -Alias "prj_sales_0001" -Type TeamSite
Set-SPOsite $salesProject1 -DenyAddAndCustomizePages 0
Connect-PnPOnline $salesProject1 -Credentials $credential
Apply-PnPProvisioningTemplate .\Contoso_Sales_Project.xml

My template has the following properties:

<pnp:PropertyBagEntries>
<pnp:PropertyBagEntry Key="vti_indexedpropertykeys" Value="" Overwrite="true" Indexed="false" />
</pnp:PropertyBagEntries>

When calling "/sites/prj_hr_0001/_api/web/allproperties" I get the web property:

<d:OData__x005f_PnP_x005f_ProvisioningTemplateId>CONTOSO.HR.PROJECT</d:OData__x005f_PnP_x005f_ProvisioningTemplateId>
and
<d:vti_x005f_indexedpropertykeys>XwBQAG4AUABfAFAAcgBvAHYAaQBzAGkAbwBuAGkAbgBnAFQAZQBtAHAAbABhAHQAZQBJAGQA|</d:vti_x005f_indexedpropertykeys>

But _PnP_ProvisioningTemplateId not appear in the crawled properties!? Bye Jens

TheHailender avatar Mar 09 '19 19:03 TheHailender

Hi,

I think I have found the solution! When I set an user as SiteCollection-Admin it works: Add-PnPSiteCollectionAdmin -Owners "[email protected]"

See https://thesharepointfarm.com/2018/11/crawled-properties-not-created-from-site-columns-in-modern-sites/

TheHailender avatar Mar 10 '19 15:03 TheHailender

This issues should be fully solved and fixed, given the work we have done in engineering in this area. To ensure that we clean up the backlog of the issues, we will be closing this one. If you still have issues on this particular area, please open up a new issue so that we can get updated issue description and reproduce steps. We do apologize the non-optimal handling of these old issues and are looking into improving this in future.

VesaJuvonen avatar Nov 01 '21 18:11 VesaJuvonen

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

ghost avatar Nov 09 '21 00:11 ghost