An owners-only library on a group-connected site is indexed, yet Search shows it to nobody
On a site connected to a Microsoft 365 group, the SharePoint Owners group usually contains a single member: the group owners claim c:0o.c|federateddirectoryclaimprovider|<groupId>_o. Search security trimming did not honour it in our measurement: content whose ACL reaches people only through the Owners group was crawled and indexed, yet queries returned 0 for both group owners we tested, while the same users found a file once they had a direct grant. Inheriting content is not affected, because its ACL also carries the Members and Visitors groups.
Na webu se skupinou M365 má skupina Vlastníci obvykle jediného člena – deklaraci vlastníků skupiny (…_o). Ořez výsledků Search ji v našem měření nevzal: obsah, ke kterému vede přístup jen přes Vlastníky, byl prošlý a v indexu, ale dotaz vrátil 0 oběma vlastníkům skupiny, které jsme zkoušeli – s přímým právem na souboru ho našli. Dědícího obsahu se to netýká, jeho ACL nese i Členy a Návštěvníky.
Symptom
- A library with broken inheritance (for example "only owners and an app's admin groups") returns
TotalRows: 0for aPath:"…/Library/*"query. - The person asking is a group owner and site collection admin; REST reads the library with full rights; the files open fine.
NoCrawlis false,Hiddenis irrelevant, versions are published, no moderation, no IRM, no default label — and a sibling library that inherits the site's permissions returns hundreds of results.- Reindexing the library (Advanced settings → Reindex document library) changes nothing, even after half an hour.
Cause
The crawler indexes the library normally. The query-time security token simply doesn't match the ACL. The ACL lists the Owners SharePoint group plus, typically, app role groups that nobody has populated yet. The Owners group holds only the _o claim, and in our measurement that claim did not count when search trimmed results. The ACL therefore names nobody search can match, so the content is invisible to everyone, owners included.
Measured on one tenant with two owner accounts, both also site collection admins. Their REST access could come from the admin role alone, so this does not show whether other permission checks honour the _o claim. It does show that neither ownership nor the admin role made the content findable.
You won't notice this on inheriting content: its ACL also contains the Members and Visitors groups.
How to prove it (in this order)
- Is it a query problem? Run the same
Path:query against a sibling library. If that one returns results, your query is fine. - Is it indexed at all? Read the crawl log for the library URL: CSOM
DocumentCrawlLog.GetCrawledUrls, see The crawl log DOES exist in SharePoint Online. Rows withErrorCode 0andNoIndex falseand a recentTimeStampUtcmean the content is in the index, so stop reindexing. - A/B the trimming. Upload a test file to the library and give the asking user direct Read on that one file. Do the same in an inheriting library as a control. After the security pass (about 10 minutes), the file with the direct grant shows up and nothing reachable only through Owners does. Delete the test files to the recycle bin afterwards.
- Read the Owners group:
/_api/web/AssociatedOwnerGroup/Users. If it lists only…federateddirectoryclaimprovider|<id>_oandSHAREPOINT\system, you've found it.
Fix
Give the content a principal that search expands:
- populate the SharePoint group the app grants access to (for example its admins or editors group) with the people who should find the content, or
- grant an Entra security group or the Microsoft 365 group's members claim, if every member may read it.
Expect a delay. After we added one user to a SharePoint group the library already granted, search still returned 0 ten minutes later and returned the content about an hour later. No reindex was needed.
Don't "fix" this by adding the site collection admin. Being a site collection admin doesn't help search trimming either.
Notes
- If you build an admin-only area that is also meant to be found (a knowledge source for AI, an in-app search), check that its ACL names somebody beyond the Owners group. Empty role groups plus owners-through-a-claim means nobody can find it.
- Data lists read only through REST are a different path. Search trimming does not apply to them, so this trap does not hide them.
- Related: Site missing from the index looks like a permissions problem covers the opposite case. There the content is missing from the index; here it's indexed but trimmed.