{"id":7618,"date":"2014-12-10T13:01:28","date_gmt":"2014-12-10T13:01:28","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/enabling-search-indexing-on-property-bag-values-in-o365\/"},"modified":"2016-07-28T10:55:54","modified_gmt":"2016-07-28T10:55:54","slug":"enabling-search-indexing-on-property-bag-values-in-o365","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/enabling-search-indexing-on-property-bag-values-in-o365\/","title":{"rendered":"Enabling Search Indexing on Property Bag Values in O365"},"content":{"rendered":"<p>SharePoint allows you to store ad-hoc values in property bags values on SPWeb objects in server-side code.&#160; You can even setup SharePoint search to crawl these properties using the server-side SPWeb.IndexedPropertyKeys property &#8211; just add the name of the property bag key to the list of IndexedPropertyKeys and the next time the crawler hits the web it will create a crawled property with the property bag value.&#160; <\/p>\n<p>But what about O365?&#160; You can only use CSOM against O365 and there is no CSOM equivalent to the IndexedPropertyKeys property that lets you define which property bag values to index.&#160; Fortunately, <a href=\"http:\/\/blogs.msdn.com\/b\/vesku\/\">Vesa Juvonen<\/a> took the time to decompile the code behind the IndexedPropertyKeys value and basically found that it contains a pipe-delimited, Base64 encoded list of the property keys to index.&#160; <a href=\"http:\/\/blogs.msdn.com\/b\/vesku\/archive\/2013\/10\/12\/ftc-to-cam-setting-indexed-property-bag-keys-using-csom.aspx\">You can find the code for this approach here<\/a>.<\/p>\n<p>One of the questions that was left unanswered, however, is whether this approach works on O365. I went ahead and tried this out on my O365 site and I can confirm that it works in O365, at least for the time being. You will have to wait for the search crawler to run again, so don&#8217;t lose hope that it&#8217;s not working if you don&#8217;t see it show up in search results right away.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SharePoint allows you to store ad-hoc values in property bags values on SPWeb objects in server-side code.&#160; You can even setup SharePoint search to crawl these properties using the server-side SPWeb.IndexedPropertyKeys property &#8211; just add the name of the property bag key to the list of IndexedPropertyKeys and the next time the crawler hits the&#8230;&hellip;<\/p>\n","protected":false},"author":46738,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[],"class_list":["post-7618","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/7618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/46738"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=7618"}],"version-history":[{"count":4,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/7618\/revisions"}],"predecessor-version":[{"id":88794,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/7618\/revisions\/88794"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=7618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=7618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=7618"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=7618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}