SharePoint 2013 - Indexed Property Keys

One of the cool features in SharePoint 2013 is the ability to index site property bag values and use them in search results page through display template.

To make it work, you'll need to do the following steps
  • Add Property Key through PowerShell (or you can do it programmatically.  I'll explain later)
$web = Get-SPWeb http://test.fakesite.com
$web.AllProperties["SiteContact"] = “Richard”
$web.IndexedPropertyKeys.Add(“SiteContact”)
$web.Update()

  • Full or incremental crawl.  Make sure you can see the crawled property from the search service application
  • Create Managed Property that maps to the crawled property

Once the managed property is created and setup properly (i.e. searchable, queryable, ...etc), then you can use it in display template.  In the example below, I created a custom display template based on Community Portal Popular Communities template and use the SiteContact property to display Primary Contact name.





















To do it programmatically using CSOM (Client Side Object Model), you can follow Vesa's blog (http://blogs.msdn.com/b/vesku/archive/2013/10/12/ftc-to-cam-setting-indexed-property-bag-keys-using-csom.aspx).

Basically, the IndexedPropertyKey value is also saved in AllProperties using key (vti_indexedpropertykeys).  The value is base 64 encoded so if you want to update it, you'll need to decode from and encode to base 64 string.

This approach will work with Office 365.








Comments

zahwahhackbarth said…
Casinos Near Atlanta, GA - Mapyro
MapYRO is the only AAA 성남 출장안마 Four Diamond casino 용인 출장샵 in the Greater Atlanta 서귀포 출장안마 metropolitan 안산 출장안마 area. Find out more about 청주 출장샵 this AAA Four Diamond property.

Popular posts from this blog

SharePoint 2013 App Details Page Error

SharePoint 2013 - Working with Display Template for Content Search Web Part

Add spell check dictionary in SharePoint 2010, SharePoint 2013, and Office 365