Metadata solution in SharePoint 2013

Metadata is information about information. Eg. Title and Author of a book are metadata. SharePoint provides options to manage metadata in many ways like adding metadata information to Lists/Libraries, creating metadata term sets, terms and translation of the terms. Adding metadata information can be beneficial in several ways.

Some of the benefits of using Metadata:

1. Can control the term sets and terms entered by the user so that the metadata values can be consistent throughout.

2. Users can be restricted to create the term sets/terms, so that only the authorized users can add terms/term sets

3. Content can be easily searched by using the metadata classification

4. Setup Metadata navigation for the lists/libraries such that the tree view structure is organized based on the metadata term hierarchy

5. Can dynamically add new terms to the set when new items are added, so that the metadata collection is maintained up to date.

Scenario and Approach

We have implemented managed metadata for one of the customers and this post gives an overview on the scenario and the approach we have taken in the implementation of the required solution.

The customer was having a large number of documents and he wanted to migrate them to SharePoint so that they are accessible through the world wide web. Since the number of documents was more and the total size was of several GBs we felt that they should also be classified appropriately and should be made easily searchable. To achieve this, we have used document Library where the metadata terms were added. Our solution consisted of the following major steps:

Analysis of document metadata structure and creation of document library

Creation of managed metadata application and metadata term sets

Add documents to library and update metadata columns

Create Search application and crawling of the site

Each of the steps are further explained below.

Analysis of document metadata structure and creation of document library

1. Browse through the list of documents to identify the possible metadata term groups and terms
2. Create the necessary metadata term groups and terms for each of the term groups
3. Structure the document library folder structure as per the needs of the customer considering also the metadata term hierarchy
4. Create the metadata columns in the document library and associate the columns with the respective term sets
5. Create a SharePoint solution using Visual Studio and add new item using the List definition template.
6. Add the required columns in the document library other than the metadata columns
7. When adding the metadata columns, create corresponding note field for each of the metadata columns. For example we had month and year metadata term sets and we have modified the schema.xml to add 2 note fields associated to the year and month columns

We also need to connect the note fields to the metadata fields inside the FeatureActivated event of the document library feature. Refer the above code sample.

Note that it is important to create note fields corresponding to all the metadata columns and the GUID of the FieldRefs and Fields should be matching. Also the note fields need to be connected to the metadata fields through code as shown above. Then only the metadata values can be programmatically updated for the metadata columns of the library.

9. Deploy the document library with the above structure into the SharePoint site.

When we create the library using the definition we created, the document library is available with the necessary fields and metadata columns. Now we need to add the metadata term sets and terms and update the term sets for each of the library items.

2. Go to the application and create Term Set Group named “DMSGRP” which is specified in the above XML schema.

3. Create the necessary term sets and terms for each of the term sets through the metadata application in the central admin

Our basic solution with the document library and the metadata term group/sets are in place. We need to add the documents of the client into our document library and devise a solution to update the metadata columns.

2. At this stage the metadata columns will be empty which should be filled for the added document library items.

3. We can device a logic for parsing the name of the document or the folder structure to determine the values of the metadata columns for the item. Eg. if the document is of the name Invoice_Apr2013, then the Year metadata value will be 2013 and Apr or April will be the value of the Month metadata. Note that the month values should be consistent throughout, eg. If its Apr, throughout it should be Apr or if April, it should be represented by April everywhere. This is ensured with the help of Terms and is one of the advantages of the Metadata management.

4. We should also maintain the same naming convention throughout and going forward the documents should be uploaded with the same conventions, so that we can get the necessary metadata values from the document being added.

5. A tool can be created to go through the document library items and add the metadata values of the metadata columns. If any metadata terms are new, they should also be added to the term store by the tool.

The above code can be used in a standalone tool to add all the metadata columns of all the document library items at once. Or we can place it in an event receiver (Eg. ItemUpdated /ItemAdded) such that the metadata values will be updated automatically whenever any new document is added or a change occurs to a document library item.

Once the metadata values are added using the tool and we have the event receivers in place, whenever any new documents are added the metadata values will be updated, going forward.

See the below images of the document library and metadata columns after creation.

This image shows the email correspondence document library structure with Company Name, Year folder hierarchy

Document Library Folder Structure

This image shows the link between the SharePoint column and Metadata term value.

Metadata Column and Linkage

Now we’ll only need to enable the search and do a crawling of the site collection.

Create Search application and crawling of the site

1. Create the Search service application in the central admin.

2. Create a content source and do a full crawling of the entire site so that our document library contents are scanned and indexes are created for search.

3. Set up a daily schedule for crawl so that the crawling happens automatically for the changed documents.

4. Now the document library can be searched using any of the metadata values or the names of any other fields of the document library items.

Example searches: by using Month metadata column values: ‘Apr’ or year metadata value : ‘2013’ should retrieve all the documents that have the Month metadata as ‘Apr’ or Year metadata column value as 2013.

The above description mentions our needs in a project and explains the approach we followed to implement of the Taxonomy/Managed metadata functionality of SharePoint 2013 for the document library. In this way the documents from windows/file server can be migrated to the SharePoint library such that they are assigned metadata and made searchable by the users.

Aspire Systems is a global technology services firm serving as a trusted technology partner for our customers. We work with some of the world’s most innovative enterprises and independent software vendors, helping them leverage technology and outsourcing in our specific areas of expertise. Our services include Product Engineering, Enterprise Transformation, Independent Testing Services and IT Infrastructure Support services. Visit www.aspiresys.com for more information.