SPSearchManagedProperty: Can't define Searchable
See original GitHub issueDetails of the scenario you tried and the problem that is occurring
I tried to add a search managed property. I wanted it to be searchable. This is the configuration I tried:
SPSearchManagedProperty TargetAudience
{
ServiceAppName = "Search Service Application"
Name = "TargetAudience"
PropertyType = "Text"
Searchable = $true
Queryable = $true
Retrievable = $true
HasMultipleValues = $true
Refinable = $true
Sortable = $true
NoWordBreaker = $false
IncludeAllCrawledProperties = $false
Ensure = "Present"
PsDscRunAsCredential = $SetupAccount
}
Running this goes smoothly, but trying Test-DscConfiguration will give an error (see below).
Without Searchable = $true there is no error in Test-DcsConfiguration, but still reports as “not in desired state”. If I check Central Administration, the property has been created, but is not searchable.
Information from the node itself:
$status = Get-DscConfigurationStatus
$status.ResourcesNotInDesiredState
ConfigurationName : SharePoint
ModuleName : SharePointDSC
ModuleVersion : 4.3.0
PsDscRunAsCredential :
ResourceId : [SPSearchManagedProperty]TargetAudience
SourceInfo : C:\xxxxxxxxxxxxxxx
DurationInSeconds : 0,469
Error :
FinalState :
InDesiredState : False
InitialState :
InstanceName : TargetAudience
RebootRequested : False
ResourceName : SPSearchManagedProperty
StartDate : 10.2.2021 11.46.28
StateChanged : False
PSComputerName :
Verbose logs showing the problem
When running Test-DscConfiguration with Searchable = $true:
Exception calling "Add" with "2" argument(s): "Item has already been added. Key in dictionary: 'Searchable' Key being added: 'Searchable'"
+ CategoryInfo : NotSpecified: (:) [], CimException
+ FullyQualifiedErrorId : ArgumentException
+ PSComputerName : xxxxxxxx
The PowerShell DSC resource '[SPSearchManagedProperty]TargetAudience' with SourceInfo 'C:\xxxxxxxx' threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are
logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : xxxxxxxxxxxxxxx
Suggested solution to the issue
N/A
The DSC configuration that is used to reproduce the issue (as detailed as possible)
See beginning.
The operating system the target node is running
N/A
Version and build of PowerShell the target node is running
PSVersion 5.1.14393.3866 BuildVersion 10.0.14393.3866
Version of the DSC module that was used
SharePointDSC 4.3.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Overview of the search schema in SharePoint Server
The search schema contains crawled properties, crawled property categories, the crawled to managed property mapping and the managed property ...
Read more >Searchable vs. Queryable vs. Retrievable vs. Refinable
In this article, I explain 4 main characteristics of SharePoint Managed Properties: Searchable, Queryable, Retrievable, Refinable.
Read more >SharePoint Search managed property: Difference 'query' ...
Searchable: Enables querying against the content of the managed property. The content of this managed property is included in the full-text ...
Read more >SharePoint search managed properties
Search schema contains a list of useful content and metadata called managed properties. The search only index from the managed property.
Read more >What makes a SharePoint column searchable?
Manage properties: Managed properties define search behavior. To configure a managed property for a SharePoint column, navigate to the search schema and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @rurikon, I found the cause of this issue. Apparently it helps if you only check a property once 😜: https://github.com/dsccommunity/SharePointDsc/blob/90f23bc730cd8d651cc4d195429d7ee659598f13/SharePointDsc/DSCResources/MSFT_SPSearchManagedProperty/MSFT_SPSearchManagedProperty.psm1#L472-L474
Will fix this issue in my next Bugfix PR, which will be included in v4.6.
Oh sorry, stupid me 😃 It doesn’t give much more info, but here it is:
We had to work on the actual property to get our project forward, so I went to Central Administration and manually checked the “Searchable” checkbox for the TargetAudience I created before. It might be relevant that after I manually checked it, the error disappeared for that property, even though it still has Searchable = $true. Here are the verbose logs for that one: