Thursday, April 28, 2016

An approach to cleaning up search schema changes in a site collection

Graham Sheeley posted a question in the Search Explained Yammer network about how to undo search schema changes at the site collection for SharePoint Online (which also applies to on-premises).

The difficult part here is to know what changes have actually been done to the schema so you can undo them. There is no magic undo button, but here’s a working procedure to remove any unwanted changes.
  1. Go to site settings for your site collection
  2. Click Search Configuration Export below Site Collection Administration
  3. Open the exported xml file in your favorite text editor, as this file will contain only the changes made at the site collection level
  4. Look for the SearchSchemaConfigurationSettings node
  5. In the ManagedProperties nodes you will find new managed properties which have been created, in the image below a new one named MikaelKnowsHisStuff
    image
  6. Re-crawl content to weed out values from the index
If you have made mappings to existing managed properties you will see these listed in the Mappings node and have to examine and possible compare with a blank site to see which have been added or removed.

Unfortunately it’s not a simple undo operation, but at least possible. This is also why I strongly advocate to re-use the reusable managed properties for your custom use, as it’s quite easy to see any mappings done in the UI, as long as you know which ones might be globally mapped.

image