Brief Introduction about Crawled and Managed Property in SharePoint 2013

Sathish Nadarajan
 
Solution Architect
January 23, 2015
 
Rate this article
 
Views
25173

By this time, all the SharePoint developers would have come to a conclusion that the entire SharePoint 2013 revolves around Search Schema. Many of us would have implemented the Custom Search Features, using JavaScript, C#, Custom Content Search WebParts etc.,

In all of these implementations, we may come across the terminology called “Crawled Property” and “Managed Property”.

In this article, let us try understand what exactly these terminologies are and SharePoint internally creates them.

As per Technet, the definition for Crawled Property is as follows.

A crawled property is content and metadata that is extracted from an item, such as a document or a URL, during a crawl.

In simple, a crawled property is nothing but a metadata for a SiteColumn. It may not be handled by the developers, but with the help of a Managed Property, we can extract the metadata from Crawled Property.

We cannot create the Crawled Property on our own. SharePoint will create the Crawled Property. We can create the Managed Property and Map the Managed Property to the Crawled Property.

So that these Managed Properties will be used by the search queries, webparts etc.,

For that, we should know, how exactly the crawled property names are framed, how SharePoint deals with that, so that we can make our own customizations accordingly. Again most of the information were already published in Technet and MSDN, I just wanted to make it handy and crispy.

For the creation of an automatically created crawled property name, the following apply:

a. Spaces are removed from the site column name.

b. For site columns of type Publishing HTML and Multiple line of text, the following prefix is added to the site column  name: ows_r_<four letter code>_

c. For site columns of type Managed Metadata, the following prefix is added to the site column  name: ows_taxId_

d. For all other site column types, the following prefix is added to the site column name: ows_q_<four letter code>_

For the creation of an automatically managed property name, the following apply:

a. Spaces are removed from the site column name

b. For site columns of type Managed Metadata, the following prefix is added to the site column name:owstaxId

c. For all other site column types, the following suffix is added to the site column name: OWS <four letter code>

Naming convention for the default site columns in the Products list

This exception applies to the six site columns that by default are associated with the Products list in the Product Catalog Site Collection, as shown in the table right below:

TitleTitleTitle
Item Numberows_q_TEXT_ProductCatalogItemNumberProductCatalogItemNumberOWSTEXT
Group Numberows_q_TEXT_ProductCatalogGroupNumberProductCatalogGroupNumberOWSTEXT
Language Tagows_q_CHCS_ProductCatalogLanguageTagProductCatalogLanguageTagOWSCHCS
Item Categoryows_taxId_ProductCatalogItemCategoryowstaxIdProductCatalogItemCategory
Rollup Imageows_r_IMGE_PublishingRollupImagePublishingImage

In SharePoint Server 2013, only site columns that contain values will automatically become managed properties when they are crawled. Regular columns will not automatically become managed properties when they are crawled.

The four letter code represents the site column type, not the managed property type. All automatically created managed properties are of type Text.

The types of the Managed Property are as follows.

TypeRequiredSystem.Int32Specifies the data type of the new managed property.

The type must be one of the following data types:

1 = Text

2 = Integer

3 = Decimal

4 = DateTime

5 = YesNo

6 = Binary

7 = Double

Examples of automatically created crawled property names and managed property names for site columns without special characters
Site column typeSite column nameCrawled property nameManaged property nameData format
Single line of textSite Column Nameows_q_TEXT_SiteColumnNameSiteColumnNameOWSTEXTAs is.
Multiple lines of textSite Column Nameows_r_MTXT_SiteColumnNameSiteColumnNameOWSMTXTAs is.
ChoiceSite Column Nameows_q_CHCS_SiteColumnNameSiteColumnNameOWSCHCSThe text value of the choice.
Choice (allow multiple selections)Site Column Nameows_q_CHCM_SiteColumnNameSiteColumnNameOWSCHCMSelected values separated by semicolon and hash mark — for example, MultiValue 2;# MultiValue 4;#.
NumberSite Column Nameows_q_NMBR_SiteColumnNameSiteColumnNameOWSNMBRTextual representation of the number. The value will use dot as a decimal symbol.

This format cannot be used in a greater than or less than comparison with other integers. It should only be used when querying for and displaying an exact value.

CurrencySite Column Nameows_q_CURR_SiteColumnNameSiteColumnNameOWSCURRTextual representation of the number. The value will use dot as a decimal symbol.

This format cannot be used in a greater than or less than comparison with other integers. It should only be used when querying for and displaying an exact value.

Date and TimeSite Column Nameows_q_DATE_SiteColumnNameSiteColumnNameOWSDATETextual representation of the date in the format YYYY-MM-DDTHH:MM:SSZ. For example, December 25, 2012, 7 AM GMT is 2012-12-25T07:00:00Z.

This format cannot be used in a greater than or less than comparison with other dates. It should only be used when querying for and displaying an exact date.

Yes/NoSite Column Nameows_q_BOOL_SiteColumnNameSiteColumnNameOWSBOOLFor true, use value 1. For false, use value 0.
Person or GroupSite Column Nameows_q_USER_SiteColumnNameSiteColumnNameOWSUSEREmail | Display | Name | EncodedClaim Claim. For example, "ellenk@contoso.com | Ellen Kessels | 693A30232E777C7265646D6F6E645C70696E676A i:0#.w|contoso\ellenk”
Hyperlink or PictureSite Column Nameows_q_URLH_SiteColumnNameSiteColumnNameOWSURHLURL, description. For example, http://www.contoso.com, Welcome to the home page of Contoso.
Publishing HTMLSite Column Nameows_r_HTML_SiteColumnNameSiteColumnNameOWSHTMLHtml escaped enclosed in a paragraph tag. For example, <p>&lt;div&gt;&lt;b&gt;some html &lt;/b&&lt;/div&gt;</p>.
Publishing ImageSite Column Nameows_q_IMGE_SiteColumnNameSiteColumnNameOWSIMGEHtml image tag. For example, <img alt="" src="/sites/pub/SiteCollectionImages/home.jpg" style="BORDER&#58;0px solid;" />.
Publishing LinkSite Column Nameows_q_LINK_SiteColumnNameSiteColumnNameOWSLINKHtml link tag. For example, <a href="http&#58;//www.microsoft.com" target="_blank" title="mytooltip">Microsoft Website</a>.
Managed MetadataSite Column Nameows_taxId_SiteColumnNameowstaxIdSiteColumnNameSee "Data format for Managed Metadata" below.
Integer*Site Column Nameows_q_INTG_SiteColumnNameSiteColumnNameOWSINTGTextual representation of the integer.

This format cannot be used in a greater than or less than comparison with other integers. It should only be used when querying for and displaying an exact value.

GUID*Site Column Nameows_q_GUID_SiteColumnNameSiteColumnNameOWSGUIDValues separated by hyphens, enclosed in brackets. For example, {147C6BA1-709C-4401-964A-27AC36B62C54}.
Grid Choice*Site Column Nameows_q_CHCG_SiteColumnNameSiteColumnNameOWSCHCGFor each row, row name separated by semi-colon and hash mark, followed by the selected value.
ContentTypeIDFieldType*Site Column Nameows_q_CTID_SiteColumnNameSiteColumnNameOWSCTIDName:#ContentTypeID;#
SPS average ratingSite Column Nameows_q_RAVG_SiteColumnNameSiteColumnNameOWSRAVGTextual representation of the number. The value will use dot as a decimal symbol.
SPS rating countSite Column Nameows_q_RCNT_SiteColumnNameSiteColumnNameOWSRCNTTextual representation of the integer.
Note:
Automatic creation of managed properties is not supported for the following site column types:

· Lookup

· Calculated

· Task outcome

· Summary Links data

· Rich media data for publishing

With this let us see, how to create Managed Properties and Use them on our code in the coming articles. In this article, thought of giving a high level introduction about the Managed Properties. Hence, most of the tables are taken from MSDN and Technet.

Happy Coding.

Sathish Nadarajan.

Category : Search, SharePoint

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

Leave a comment