문제

How can we check if the property bag is indexed and searchable?

And also how is the index value for 'vti_indexedpropertykeys' encoded?

I am trying to update the property bag's index using CSOM C# in .NET.So wanted to know how to verify it and know in what format the values are stored?

I found a AddIndexedPropertyBagKey property but do not know what value to set it with and what does it do.

Web web = clientContext.Site.RootWeb;
clientContext.Load(web, w => w.AllProperties);
clientContext.Load(web, w => w.Description);
clientContext.Load(web, w => w.Title);
clientContext.ExecuteQuery();
var allProperties = web.AllProperties;
web.AddIndexedPropertyBagKey = ?? 
도움이 되었습니까?

해결책

I would suggest that you use the PnP Core Nuget package in your project.

It is a wrapper over the Native CSOM C# and provides a lot of extensions.

Using that, you can easily set the property bag value as well as mark it as indexed.

Use the below code:

Web web = clientContext.Site.RootWeb;
clientContext.Web.SetPropertyBagValue("key", "value");
clientContext.Web.AddIndexedPropertyBagKey("key");

To get the IndexedProperty bag you can fetch the list of indexed property bags. If your property bag is marked as indexed, it will be available in the list:

var indexedPropertyBags = clientContext.Web.GetIndexedPropertyBagKeys();

Nuget Package - SharePointPnPCoreOnline

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top