Forum Discussion

Mike Jansen's avatar
Mike Jansen
Iron Contributor
Nov 24, 2017
Solved

SharePoint provisioning with script; crawled property question (only available after item in list?)

I want to do a scripted site-collection provisioning. So I create everything by script, like:

- Managed metadata

- Crawled properties

- Managed properties

- Content types

- Lists

- Etc

 

It looks like I am facing a challenge creating  managed properties. This is what I do:

 

- I create custom content types

- add the to a list

 

I assume the crawled properties are generated by SharePoint but they are not.

It looks like they are only generated when I add an item to the list.

Only then they appear in the crawled properties. After that I can create Managed properties.

 

Am I right? Or do I miss something here? 

If so, is there some kind of workaround?

 

Thanks, Mike

  • HI Mike Jansen,

     

    Yes that is right. As a workaround I quite often provisioned a test list with al of my columns included and then create one list item through my provisioning scripts. 

10 Replies

  • HI Mike Jansen,

     

    Yes that is right. As a workaround I quite often provisioned a test list with al of my columns included and then create one list item through my provisioning scripts. 

    • Mike Jansen's avatar
      Mike Jansen
      Iron Contributor

      Hi Pieter Veenstra,

      That's a quick answer ;-) Thanks.

      In case of SharePoint online, you wait for 24 hours so the crawl ran?

      • Pieter Veenstra's avatar
        Pieter Veenstra
        MVP

        Hi Mike Jansen,

        Continuous crawl seems to do the job, sometimes it would fail though. Then forcing the updated crawls by going to the list's advanced settings and force the re-index works.

Resources