Skip to content

Add the ability to create an explicit crawled property at the tenant level#5373

Open
pschneid wants to merge 11 commits into
pnp:devfrom
pschneid:feature/add-tenant-search-crawled-property
Open

Add the ability to create an explicit crawled property at the tenant level#5373
pschneid wants to merge 11 commits into
pnp:devfrom
pschneid:feature/add-tenant-search-crawled-property

Conversation

@pschneid

@pschneid pschneid commented Jun 29, 2026

Copy link
Copy Markdown

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

N/A

What is in this Pull Request ?

This utilizes the ability to import a search configuration to allow users to create explicit crawled properties at the tenant level. I've limited this to the tenant level because if you create one at the site level you will always have to maintain the mappings separately from the tenant-level.

The preferred usage is to use the -PropSet flag and choose the appropriate choice. It will warn you if you try to create an ows_q_XYZ property using the taxonomy property set, for example. People with need can use the -PropSetGuid option to create rare or non-standard property sets (not recommended).

There are times where SharePoint admins may, for example, need to make a crawled property explicit but can't see it on the schema admin page because, for example, they don't have access to any content that has an implicit version of the property. This allows them to work around that issue.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new SharePoint Online tenant admin cmdlet to create explicit crawled properties by importing an additive search schema configuration package, enabling admins to pre-create crawled properties even when implicit ones are not visible.

Changes:

  • Introduces Add-PnPTenantSearchCrawledProperty cmdlet to create tenant-level crawled properties using recommended (enum-based) or GUID-specified property sets
  • Adds unit tests validating the generated search configuration XML payload
  • Adds end-user documentation and a new SearchCrawledPropertySet enum for the -PropertySet parameter

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/Commands/Search/AddTenantSearchCrawledProperty.cs Implements the new cmdlet, including property set selection, warnings/confirmation, schema ID resolution, and search config import payload generation
src/Commands/Enums/SearchCrawledPropertySet.cs Adds enum backing the -PropertySet parameter for recommended property sets
src/Tests/Search/AddPnPTenantSearchCrawledPropertyTests.cs Adds tests validating generated XML structure/values for tenant crawled property creation
documentation/Add-PnPTenantSearchCrawledProperty.md Adds cmdlet help documentation, syntax, examples, and parameter reference

Comment thread src/Commands/Search/AddTenantSearchCrawledProperty.cs
Comment thread src/Commands/Search/AddTenantSearchCrawledProperty.cs
Comment thread src/Tests/Search/AddPnPTenantSearchCrawledPropertyTests.cs Outdated
Comment thread documentation/Add-PnPTenantSearchCrawledProperty.md
Comment thread documentation/Add-PnPTenantSearchCrawledProperty.md Outdated
@pschneid

Copy link
Copy Markdown
Author
  • Switched to the existing Resources alias for the confirmation prompt.
  • Cleaned up the output object initializer and made CategoryName/MapToContents explicit.
  • Added an assertion for the reflected test helper lookup.
  • Reordered the parameter docs alphabetically.
  • Added the standard Related Links section.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread src/Commands/Search/AddTenantSearchCrawledProperty.cs Outdated
…enant admin site.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread src/Commands/Search/AddTenantSearchCrawledProperty.cs Outdated
Comment thread src/Commands/Search/AddTenantSearchCrawledProperty.cs Outdated
wobba and others added 2 commits June 30, 2026 13:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread src/Commands/Search/AddTenantSearchCrawledProperty.cs Outdated
Comment thread src/Commands/Search/AddTenantSearchCrawledProperty.cs
Comment thread src/Tests/Search/AddPnPTenantSearchCrawledPropertyTests.cs
@pschneid

Copy link
Copy Markdown
Author

Addressed latest feedback.

@wobba

wobba commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@erwinvanhunen this one looks good to me.

@KoenZomers

Copy link
Copy Markdown
Collaborator

@pschneid @wobba Any particular reason for not having the cmdlet inherit from PnPAdminCmdlet but instead building in manual validation based on -admin in the URL?

@pschneid

pschneid commented Jul 3, 2026

Copy link
Copy Markdown
Author

@pschneid @wobba Any particular reason for not having the cmdlet inherit from PnPAdminCmdlet but instead building in manual validation based on -admin in the URL?

Because I'm not an expert in PnP and am trying to help add something that will make people's lives easier?

@wobba

wobba commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

@pschneid @wobba Any particular reason for not having the cmdlet inherit from PnPAdminCmdlet but instead building in manual validation based on -admin in the URL?

@pschneid please make the suggested change. Inheriting from admin makes the admin connection better/easier.

@pschneid

pschneid commented Jul 3, 2026

Copy link
Copy Markdown
Author

Switched to using admin context.

@KoenZomers

Copy link
Copy Markdown
Collaborator

Thanks @pschneid . Will test it out here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants