pnp / PnP-Sites-Core

Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
Other
416 stars 642 forks source link

Index standard property bag #2039

Open orty opened 5 years ago

orty commented 5 years ago

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. If you have a actual question, we would ask you to use SharePoint Developer Group at Microsoft Tech Community. Thanks!

Which PnP repository should you use to report the issue?

Category

[ ] Bug [X] Enhancement

Environment

[X] Office 365 / SharePoint Online [ ] SharePoint 2016 [ ] SharePoint 2013

If SharePoint on-premises, what's exact CU version:

Expected or Desired Behavior

Hi, I am trying to access some modern team sites properties through the search index (i.e. GroupId, GroupType, etc.) but they are not indexed by default. I initially thought I could index them using the <pnp:PropertyBagEntry Overwrite="xsd:boolean" Indexed="xsd:boolean"> </pnp:PropertyBagEntry> entry in my provisioning template, with the Indexed attribute value set to "true", but then I would have to guess the initial value of the property to avoid changing it. So I took a look in the PnP provisioning engine Tokens and was surprised that none exist for getting the actual value of property bag, like {site.GroupId} or {propertybagvalue:GroupId}. Even if there is a workaround for my initial need (indexing standard web properties without changing their value), I really think it could be a nice improvement to have access to the existing properties values to use them in the provisioning schema.

Thanks a lot.

wobba commented 5 years ago

Hi, Sounds like a smart idea to expose groupid/hubsiteid as tokens and should be easy enough.

There is a managed property named ’GroupId’ but haven’t checked if it returns a value or not for items.

orty commented 5 years ago

Hi, You are right, the GroupId managed property contains the value for the GroupId web property, even if it is not indexed. My question remains, if we wanted to expose another web property through the search index, would this evolution of the provisioning engine be interesting ?

wobba commented 5 years ago

@orty I think so :) I'll start by adding support for a few more site tokens. If you have a specific list in mind outside of GroupId let me know.

orty commented 5 years ago

I was more thinking about a generic token like {propertybagvalue:GroupId} but if we can have at least GroupId et GroupType (for public/private flag) it would be a good start :)

wobba commented 5 years ago

@orty Ahhh... so if you use {propertybagvalue:GroupId} you want the engine to look for that property bag value and replace it. Good idea!

orty commented 5 years ago

It would be a very interesting and powerful addition to the token parser :). Hope it's not too hard to implement.