-
Notifications
You must be signed in to change notification settings - Fork 408
Add the ability to create an explicit crawled property at the tenant level #5373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pschneid
wants to merge
11
commits into
pnp:dev
Choose a base branch
from
pschneid:feature/add-tenant-search-crawled-property
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+572
−0
Open
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
aa3fefd
Add tenant search crawled property support
pschneid 7a299b5
Add tenant search crawled property support
pschneid 71e10c9
Remove temporary crawled property sample script
pschneid 6e5d4c6
Add tenant search crawled property support
pschneid f9e89f6
Address tenant crawled property review feedback
pschneid d6eef67
Merge branch 'dev' into feature/add-tenant-search-crawled-property
pschneid 9b2b68e
Avoid allocating and culture-lowering the URL when checking for the t…
pschneid a36aadb
Potential fix for pull request finding
wobba 9996a29
Add required permissions for crawled property cmdlet
pschneid be72be7
Address crawled property cmdlet review feedback
pschneid 237e700
Use admin context for tenant crawled property cmdlet
pschneid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| --- | ||
| Module Name: PnP.PowerShell | ||
| title: Add-PnPTenantSearchCrawledProperty | ||
| schema: 2.0.0 | ||
| applicable: SharePoint Online | ||
| external help file: PnP.PowerShell.dll-Help.xml | ||
| online version: https://pnp.github.io/powershell/cmdlets/Add-PnPTenantSearchCrawledProperty.html | ||
| --- | ||
|
|
||
| # Add-PnPTenantSearchCrawledProperty | ||
|
|
||
| ## SYNOPSIS | ||
|
|
||
| Adds a tenant-level search crawled property. | ||
|
|
||
| ## SYNTAX | ||
|
|
||
| ### KnownPropertySet | ||
|
|
||
| ```powershell | ||
| Add-PnPTenantSearchCrawledProperty -Name <String> -PropertySet <SearchCrawledPropertySet> | ||
| [-Force] [-Connection <PnPConnection>] | ||
| ``` | ||
|
|
||
| ### PropertySetGuid | ||
|
|
||
| ```powershell | ||
| Add-PnPTenantSearchCrawledProperty -Name <String> -PropertySetGuid <Guid> | ||
| [-Force] [-Connection <PnPConnection>] | ||
| ``` | ||
|
|
||
| ## DESCRIPTION | ||
|
|
||
| Creates a tenant-level crawled property by importing an additive search schema configuration package. This cmdlet must be run against the tenant admin site. | ||
|
|
||
| Most SharePoint crawled properties should use one of these property sets: SharePointDefault, SharePointTaxonomy, SharePointStructured, or SharePointRich. Other supported property sets can be specified by GUID for advanced scenarios, but the cmdlet will ask for confirmation unless -Force is specified. | ||
|
|
||
| This cmdlet is additive only. SharePoint Online does not expose a supported PnP PowerShell command to delete crawled properties created in error or to move an existing crawled property to a different property set. Verify the crawled property name and property set before running this cmdlet in a production tenant. | ||
|
|
||
| If this cmdlet is used to make an implicit crawled property explicit, SharePoint Online will stop automatically creating an implicit managed property for that crawled property going forward. | ||
|
|
||
| ## EXAMPLES | ||
|
|
||
| ### EXAMPLE 1 | ||
|
|
||
| ```powershell | ||
| Add-PnPTenantSearchCrawledProperty -Name "ows_ProjectCode" -PropertySet SharePointDefault | ||
| ``` | ||
|
|
||
| Creates a common SharePoint crawled property. | ||
|
|
||
| ### EXAMPLE 2 | ||
|
|
||
| ```powershell | ||
| Add-PnPTenantSearchCrawledProperty -Name "ows_q_TEXT_ProjectCode" -PropertySet SharePointStructured | ||
| ``` | ||
|
|
||
| Creates a structured SharePoint crawled property. | ||
|
|
||
| ### EXAMPLE 3 | ||
|
|
||
| ```powershell | ||
| Add-PnPTenantSearchCrawledProperty -Name "ows_taxId_ProjectCategory" -PropertySet SharePointTaxonomy | ||
| ``` | ||
|
|
||
| Creates a taxonomy crawled property. | ||
|
|
||
| ### EXAMPLE 4 | ||
|
|
||
| ```powershell | ||
| Add-PnPTenantSearchCrawledProperty -Name "ows_r_HTML_Description" -PropertySet SharePointRich | ||
| ``` | ||
|
|
||
| Creates a crawled property for a rich or complex field. | ||
|
|
||
| ### EXAMPLE 5 | ||
|
|
||
| ```powershell | ||
| Add-PnPTenantSearchCrawledProperty -Name "ows_ProjectCode" -PropertySetGuid "00130329-0000-0130-C000-000000131346" -Force | ||
| ``` | ||
|
|
||
| Creates a crawled property by specifying the supported property set GUID directly. | ||
|
|
||
| ## PARAMETERS | ||
|
|
||
| ### -Connection | ||
|
|
||
| Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. | ||
|
|
||
| ```yaml | ||
| Type: PnPConnection | ||
| Parameter Sets: (All) | ||
|
|
||
| Required: False | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -Force | ||
|
|
||
| Suppresses confirmation prompts for less common property sets, direct GUID usage, or crawled property names that do not match the selected property set. | ||
|
|
||
| ```yaml | ||
| Type: SwitchParameter | ||
| Parameter Sets: (All) | ||
|
|
||
| Required: False | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -Name | ||
|
|
||
| Name of the crawled property to create. | ||
|
|
||
| ```yaml | ||
| Type: String | ||
| Parameter Sets: (All) | ||
|
|
||
| Required: True | ||
| Position: 0 | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -PropertySet | ||
|
|
||
| Known property set to use for the crawled property. Recommended values are SharePointDefault, SharePointTaxonomy, SharePointStructured, and SharePointRich. | ||
|
|
||
| ```yaml | ||
| Type: SearchCrawledPropertySet | ||
| Parameter Sets: KnownPropertySet | ||
| Accepted values: SharePointDefault, SharePointTaxonomy, SharePointStructured, SharePointRich | ||
|
|
||
| Required: True | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -PropertySetGuid | ||
|
|
||
| Supported property set GUID to use directly. Prefer -PropertySet for normal usage. | ||
|
|
||
| ```yaml | ||
| Type: Guid | ||
| Parameter Sets: PropertySetGuid | ||
|
|
||
| Required: True | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ## RELATED LINKS | ||
|
|
||
| Microsoft 365 Patterns and Practices https://aka.ms/m365pnp | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| namespace PnP.PowerShell.Commands.Enums | ||
| { | ||
| public enum SearchCrawledPropertySet | ||
| { | ||
| SharePointDefault, | ||
| SharePointTaxonomy, | ||
| SharePointStructured, | ||
| SharePointRich | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.