Share-n-dipity

SharePoint serendipity is the effect by which one accidentally discovers something fortunate, especially while looking for something else entirely. In this case, it is the occassional musings, observations, and Ouija board readings about the phabulously

Creating Managed Properties in a Site Collection in SharePoint 2013

Creating Managed Properties in a Site Collection in SharePoint 2013

  • Comments 10
  • Likes

There are many cool things about search in SharePoint 2013, and one that I think is really going to help growing search verticals for departments and business units is the ability to create managed properties down to the site collection level.  Managed properties are frequently used in search verticals because they give you a way to define custom attributes associated with your data that you want to use for purposes of filtering, reporting, and/or refining.  In SharePoint 2010 and prior versions of SharePoint there were a couple of limitations with how they were used that made them kind of cumbersome:

  • You could only create them at the Search Service Application (SSA) level
  • It required a full crawl of all your content first to create a crawled property, and then a second full crawl of all your content to create a managed property.  This was tough for many organizations.

 

In SharePoint 2013 we open this up and make it a lot more accessible.  You can still create managed properties at the SSA level, but now you can also augment those with managed properties at the site collection level. The whole process starts out like before, creating a crawled property.  Again, a new feature here is that when you create a site column in SharePoint 2013, it is automatically configured to be a crawled property before you ever do your first crawl.  Very cool!  After that you can add your site column to any list or library and start adding content.

Now to create a new managed property you can go into the Site Settings and then Search Schema in the Site Collection Administration section.  From there you can create a new managed property and map it back to the crawled property.  Now one of the big differences between managed properties created in the site collection versus the SSA is that when you create new managed properties in the site collection they have three limitations you should be aware of:

  • They can only be text
  • They cannot be sortable
  • They cannot be refinable

You are not out of luck though!  Out of the box we ship a bunch of managed properties expressly for this purpose.  If you look in the list of managed properties you will see things like RefinableDate00..19, RefinableDecimal, RefinableDouble…RefinableString100, etc.  So when you need a non-string value, or you need something sortable or refinable you can use one of these properties.  Let me explain how it works by way of example.

You create a new site column called FavoriteColor; it's a Choice column containing Blue, Green and Red and you want to create a new refinable managed property for it.  First you add it to your list or library, and then drop in some content.  Next you're going to go into Site Settings...Search Schema and scroll down until you find RefinableString00, then edit it.  In the alias field type "Favorite Color", and in the Mappings to crawled properties field, add a Mapping to the ows_FavoriteColor crawled property then save your changes.  That looks something like this:

 

Now once that's done we still need to do a full crawl, but wait - there's a new way to do that in SharePoint 2013 as well.  :-) We no longer need to do a full crawl of the entire corpus - instead we can ask for a "full crawl" of just a single site, or even a single list.  In this case you would want to go into your list where you are using your FavoriteColor column and then go into the Site Settings.  If you click on the Advanced Settings link you can scroll down until you find the Reindex document library (or Reindex list if you are using a list).  Click that link to configure the list to be crawled.  Now the next time any kind of crawl kicks off from the SSA - incremental or full - it will populate the managed property and you can start using it in your queries, query rules and display templates.

Hope this helps you get started creating these yourself.

Comments
  • Hi Steve,

    Thank you for the excellent article.  A quick question about backup and restore...

    If you migrate content databases between farms or export the site / site collection.  Do the crawled and managed properties, when created at the site level, come across as well?

    Kind regards

    Giles

  • Yes they do.  Even better than that though, you can export and import just the search content from the site collection.  By "site content" I mean result sources, query rules, result types, schema (like managed properties), and custom ranking models.  Look at the "Export Search Configuration" and "Import Search Configuration" in Site Settings.

  • That is going to be a massive improvement for my future projects.  Thank you.

    Kind regards

    Giles

  • Steve, in SP2010 is it possible to created Managed Properties for pre-existing crawled properties, via the service application? There's a setting in Search Service Application, that allows me to check "Automatically generate a new managed property for each crawled property". This only seems to apply to new properties that I create and not previously created ones. Any idea how I can force it to go back and assign a managed property to a crawled property that was already created prior to changing this setting?

  • Hi Steve,

    Does this process you mentioned above apply to SPOL 2013 as well? I created a new site collection hosted by MS today and added two managed metadata fields (Project Phase and Project Type). I added those fields to a content type, then added the CT to a doc lib and added docs to it. I then went through and tagged each doc with this new MM. I've looked through the crawled properties at site collection level, but can't tell if the fields I created are there or not. When I search by either MM field, I do get results back for these categories: Office / SharePoint. I'm guessing those aren't the fields I created.

    Regards,

    Beth

  • Thanks for the article. However I am facing an issue. Hope you can help me on this. I can see only View Managed Property option and cannot edit the existing managed property(RefinableString00). I am working on a site collection (SP 2013 online) and I have site collection Admin Rights. Any idea why I am not able to edit the existing managed property.

  • Very cool! Just make sure you click the "Site Collection Administration -> Search Schema" link and not the "Search -> Schema" link on the site settings page!! The latter is view only and is probably there to enable non site collections admins, this is site owners, to browse the list of available properties.

  • Really nice post. Thanks Steve!

  • Hi Steve,

    Need to ask one thing, i checked RefinableString managed property but it's characteristics Search is not checked. So, crawl property whom i am mapping with this property searchable or not?

    Also, is there any multiple line of text managed property exist so that i can map multiple line of text crawl property to managed property.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment