Content/File results returned by SOSL search on contentDocument include only documents owned by user if ORDER BY added to SOSL search
Last updated 2018-01-16 ·Reference W-4144479 ·Reported By 0 users
Summary
When running a SOSL search on contentDocument, if the ORDER BY clause is used only the documents owned by the user will be returned
Repro
1) Create 3 or 4 files as user1
2) As user 2 create 2 or 3 files
3) Run a SOSL search such as:
FIND {SomeSearchTerm} IN ALL FIELDS RETURNING ContentDocument(ID,OWNERID,LastModifiedDate)
* Note you will get the full complement of documents
4) Then add an ORDER BY to the SOSL:
FIND {someSearchTerm} IN ALL FIELDS RETURNING ContentDocument(ID,OWNERID,LastModifiedDate ORDER BY LastModifiedDate)
*Issue*> Now you will only get the documents the current user owns
Workaround
Until this is resolved, avoid adding ORDER BY clauses to SOSL searches on ContentDocument. Instead, sort the results after they are returned
Reported By (0)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.