Forum Discussion
Applying Search Schema fails
This may be related to what I'm seeing in my tenant.
After using Get-PredictedCrawledProperties.ps1 and Add-PnPTenantSearchCrawledProperty to make previously missing crawled properties explicit, the Selected properties picker in the PnP Modern Search Results web part stopped loading and remains in an infinite loading state.
During troubleshooting I found that the request used to retrieve managed properties fails with HTTP 400 when sorting is performed on [DocId], but succeeds when the sort field is changed to Created.
I tested several variations directly against the Search REST API:
ManagedProperties via GET → HTTP 200
ManagedProperties via POST (without SortList) → HTTP 200
POST with SortList on [DocId] → HTTP 400
POST with SortList on DocId → HTTP 400
POST with SortList on Title → HTTP 400
POST with SortList on Created → HTTP 200
The original PnP request also succeeds if I change only the sort property from [DocId] to Created.
Based on that, it looks more like a SharePoint Search REST API issue related to sorting on DocId than an issue with the managed properties themselves.
Can anyone else reproduce this?