function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KilvatiKilvati 

Full text search in ContentVersion (CRM Content) objects from Apex

I figured out how to create and link ContentVersion objects from Apex code. Now I want to search through the content of these objects using Apex. Is this possible at all? I can not find any thing about this. Has somebody succeeded in doing this?

 

gm_sfdc_powerdegm_sfdc_powerde
KilvatiKilvati

Thanks for the answer! I didn't know SOSL was this powerful, but now I do.

KilvatiKilvati

I have upload a simple document both as a contentversion and an attachment into my salesforce. But when I search using SOSL (e.g.: [FIND 'SpecialWord' IN ALL FIELDS RETURNING ContentVersion] and [FIND 'SpecialWord' IN ALL FIELDS RETURNING attachment (body)] ), I get no results. Is this not possible, or am I to impatient and does it take a long time to index?

gm_sfdc_powerdegm_sfdc_powerde

It could take a while to index as the indexing is done asynchronously.  Did you try after a while?

Larry LeonidasLarry Leonidas

Were you ever able to get the FullText search on items such as PDF, Docx, etc. using SOSL. I am trying something similar but to no avail...