Add the ability to create an explicit crawled property at the tenant level#5373
Open
pschneid wants to merge 11 commits into
Open
Add the ability to create an explicit crawled property at the tenant level#5373pschneid wants to merge 11 commits into
pschneid wants to merge 11 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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-PnPTenantSearchCrawledPropertycmdlet 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
SearchCrawledPropertySetenum for the-PropertySetparameter
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 |
Author
|
…enant admin site. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Author
|
Addressed latest feedback. |
Contributor
|
@erwinvanhunen this one looks good to me. |
Collaborator
Author
Contributor
Author
|
Switched to using admin context. |
Collaborator
|
Thanks @pschneid . Will test it out here as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
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.