Using PowerShell to create a crawled property in SharePoint 2016

I recently ran into an issue while implementing Hybrid Search at a client. My problem was that the new Cloud Search Service was not creating crawled properties from all the site columns. This caused issues, because we are using search query web parts to provide some good looking navigation on the landing pages.

After much google-fu, resetting the index and performing more Full Crawls than I care to mention, I eventually cleared it up by using PowerShell to manually create the crawled property and building a managed property off of that.

I’m not really sure how SharePoint knows which site column to index into the crawled property these command-lets create, but it worked for me and hopefully it will for you too.

 

New-SPEnterpriseSearchMetadataCrawledProperty -Category SharePoint -IsNameEnum $false -Name “ows_CrawledProperty” -PropSet 00130329-0000-0130-c000-000000131346 -SearchApplication “Search Service Application”

-Category dictates which search schema category the crawled property will be created in

-SearchApplication will specify which search service to create the crawled property in

-PropSet is a bit of a mistery to me. I haven’t been able to find a great explanation of what it is, but apparently the value for most site columns is  00130329-0000-0130- c000-000000131346

 

Once this is has been run, perform a full crawl and the crawled property will appear in the search schema of the specified search service, and you can create managed properties with it through the Central Administration GUI or PowerShell

Advertisement

2 thoughts on “Using PowerShell to create a crawled property in SharePoint 2016

  1. I’ve been conquering this problem a time ago.
    And ran into teribble issues with the search service application – due to duplicate crawled properties (in different propsets)
    The only thing i found out was that Taxonomy (managed metadata) are stored in a different propset.
    Property Set ID: 158d7563-aeff-4dbf-bf16-4a1445f0366c
    And that the Taxonomy Fields need a second Crawled Property wich starts with “ows_taxId_”+fieldName
    As you said, the propset is neighter documented nor are there any good samples.

    1. Thanks for the comment. As you say, this can be a very complicated piece of work once you get into it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s