powershell icon indicating copy to clipboard operation
powershell copied to clipboard

Update set-pnpfield with no crawl to prevent the field from being returned in search results

Open reshmee011 opened this issue 1 year ago • 5 comments

Type

  • [ ] New Feature

What is in this Pull Request ?

Add no crawl property to set-pnpfield Update set-pnpfield to prevent the field from being returned in search results

reshmee011 avatar Feb 23 '24 06:02 reshmee011

@reshmee011 - can you also please add it to docs as well ?

gautamdsheth avatar Feb 23 '24 09:02 gautamdsheth

@gautamdsheth : I have updated the docs. Forgot to push the changes for the docs earlier..

reshmee011 avatar Feb 23 '24 09:02 reshmee011

@reshmee011 - do we really need this ? I mean , we can easily do it via something like this. Works for almost all properties.

Set-PnPField -Identity "Test" -Values @{NoCrawl=$true}

gautamdsheth avatar Feb 23 '24 09:02 gautamdsheth

@gautamdsheth , updating NoCrawl property is failing using method -values @{NoCrawl=$true} as well the switchparameter -nocrawl.

image

Something changed to prevent the update to the NoCrawl at column level. I will raise it with Microsoft and wait for an answer.

Happy for the PR to be closed and to use the -values option to update the property.

reshmee011 avatar Feb 23 '24 10:02 reshmee011

Ok, sure. Will keep it open, let me know what MS responds to this , we can merge it later then. Thanks :)

gautamdsheth avatar Feb 23 '24 12:02 gautamdsheth

It seems to be able to set the field as non crawlable, the "SharePoint Server Publishing Infrastructure" has to be activated which is not a recommended solution , hence closing the PR.

reshmee011 avatar Apr 03 '24 03:04 reshmee011

It seems to be able to set the field as non crawlable, the "SharePoint Server Publishing Infrastructure" has to be activated which is not a recommended solution , hence closing the PR.

reshmee011 avatar Apr 03 '24 03:04 reshmee011