Thursday, January 11, 2024

Demystifying Author properties on files in SharePoint and search

demystify

For as long as I have been doing SharePoint, figuring out what properties to use when filtering or displaying search results in regards to people has been a challenge as the documentation in this space is somewhat lacking. I’m not sure why I haven’t done this writeup earlier, but no time like the present.

Before getting into the technical details, I would like to clarify the meaning of the term Author. In common usage, the term Author refers to people who have composed a piece of text. For instance, I am the author of my three books on enterprise search. If someone gets a PDF copy of the book and upload it in a SharePoint library, that person will be recorded as the Creator and Last Modifier of the file – but they are still not the author.

To simplify matters to avoid a clash of semantics and technical abilities we are likely better off talking about contributors or modifiers of a file. The exception is if you somehow have 100% control of people adding correct Author metadata to file metadata. I have never witnessed this in my twenty years of working in the search field, and if you are the one who can prove me wrong, please contact me so we can reveal this amazing piece of information to everyone!

For my test scenario I created a Word file and have populated the metadata fields inside of Word.


image

Regarding my previous comment on Author. The Author field in Word is fine if it has the right value. But often this value comes from Word templates or copies of other files that have new content. Changing the value is not easy unless you know how - so it's safer to assume the value is unreliable. Also it is a textual property, not tied to any user accounts.

Steps taken for the test

  • Uploaded the file as Mr Debug.
  • Modified the file as my admin account
  • Modified the file as Demo Ghost
  • Modified the file as my admin account
image

The list of properties below are people properties related to file modifications. For reference UPN = User Principal Name, or the account name. Property features listed relate to the search schema capabilities of the property:

  • Query = property may be used in a KQL property query to target items with a value in that field. E.g. Author:(Foo Bar)
  • Search = property is included in the full text index, meaning recall will include items matching on the value regardless of a property query
  • Retrieve = the value of the property may be requested and returned in search results
  • Refinable = the property may be used in a filter/refiner aggregation, or for sorting
  • Sort = the property may be used to sort results

List of properties

Field: Author
Value: Foo Bar, Yooba - Word props;Mr Debug;Mikael Svenson (nerd)
Description: Semi-colon separated list, concatenated of the manual value from the file, the display name of the person uploading the file, and the display name of the last person modifying the file.
Property features: Query, Search, Retrieve, Sort

Field: DisplayAuthor
Value: Foo Bar, Yooba - Word props;Mr Debug;Mikael Svenson (nerd)
Description: Semi-colon separated list, concatenated of the manual value from the file, the display name of the person uploading the file, and the display name of the last person modifying the file.
Property features: Query, Retrieve, Refine, (Sort)

Field: MetadataAuthor
Value: Foo Bar, Yooba - Word props Mr Debug
Description: Information added in the Author field inside the Word document as seen in the screenshot above.
Property features: Query, Retrieve

Field: AuthorOWSUser
Value: debug@contoso.com | Mr Debug | 693A30232E667C6D656D626572736869707C646562756740746563686D696B61656C2E636F6D i:0#.f|membership|debug@contoso.com
Description: Pipe separated values of the person creating/uploading the file: E-mail address, display name, hex encoded UPN claim, UPN claim.
Property features: Query, Retrieve

Field: EditorOWSUser
Value: miksvenson@contoso.com | Mikael Svenson (nerd) | 693A30232E667C6D656D626572736869707C6D696B7376656E736F6E40746563686D696B61656C2E636F6D i:0#.f|membership|miksvenson@contoso.com
Description: Pipe separated values of the person last modifying the file or metadata of the file: E-mail address, display name, hex encoded UPN claim, UPN claim.
Property features: Query, Retrieve

Field: CreatedBy
Value: Mr Debug
Description: Display name of the person creating/uploading the file.
Property features: Query, Retrieve

Field: CreatedById
Value: debug@contoso.com | Mr Debug | 693A30232E667C6D656D626572736869707C646562756740746563686D696B61656C2E636F6D i:0#.f|membership|debug@contoso.com
Description: Pipe separated values of the person creating/uploading the file: E-mail address, display name, hex encoded UPN claim, UPN claim.
Property features: Query, Retrieve

Field:
ModifiedBy
Value: Mikael Svenson (nerd)
Description: Display name of the last person modifying the file.
Property features: Query, Retrieve, Sort

Field: ModifiedById
Value: miksvenson@contoso.com | Mikael Svenson (nerd) | 693A30232E667C6D656D626572736869707C6D696B7376656E736F6E40746563686D696B61656C2E636F6D i:0#.f|membership|miksvenson@contoso.com
Description: Pipe separated values of the person last modifying the file or metadata of the file: E-mail address, display name, hex encoded UPN claim, UPN claim.
Property features: Query, Retrieve

The next four properties all belong together.

Field: ModifierNames
Value: Mikael Svenson (nerd);Demo Ghost;debug
Description: Semi-colon separated list of the display name all modifiers of the file in descending order after their last edit.
Property features: Query, Retrieve

Field: ModifierAADIds
Value: 2ef3eebc-b4b7-44c3-91b1-f74de07011e8;6dfd6325-d1d0-4910-a44c-47a65467c615;76075fc5-d606-4344-a74d-cec458184087
Description: Semi-colon separated list of the AAD Id’s (entra id) of all modifiers of the file in descending order after their last edit.
Property features: Query, Retrieve, Refine, Sort

Field: ModiferUPNs
Value: miksvenson@contoso.com;demo@contoso.com;debug@contoso.com
Description: Semi-colon separated list of the UPN’s of all modifiers on the file in descending order after their last edit.
Property features: Retrieve

Field: ModifierDates
Value: 2024-01-11T09:14:02Z;2024-01-11T08:59:25Z;2024-01-11T08:45:48Z
Description: Semi-colon separated list of the date each modifier of a file made their last edit in descending order.
Property features: Retrieve

I used the awesome browser plugin SP Editor from Tomi Tavela to produce my output, available for Chrome and Edge.