+ Start a Discussion
Larry LeonidasLarry Leonidas 

SOSL ContentVersion Full-Text Search

I'm facing a problem trying to search for Content. We are basically trying to return search results using SOSL on the ContentVersion object. We're expecting full-text search results (words within the PDF or DOC), but results are returned only on ContentVersion.Title.

 

List<List<SObject>> contentresults1 = [FIND :SearchVal IN ALL FIELDS RETURNING ContentVersion (id, Title, Description)];

Scott_VSScott_VS

You might be out-of-luck. The VersionData field is base64 encoded through the API, so you will not be able to do a plain-text search on that field.

Larry LeonidasLarry Leonidas

Thanks for the response. Salesforce does handle this within their Global Search feature, so an index is being maintained, wonder how this can be leveraged in Apex?

 

See http://login.salesforce.com/help/doc/en/content_search.htm

highland23highland23

I'm interested in this as well. Did anyone find a way via APEX or the API to do a full-text search of content?

SFDCMattSFDCMatt

I'm trying to do the same. Did anyone figure this out?

SFDCMattSFDCMatt

In this thread one of the PMs indicates that document content (at least some of it) is indexed and in scope for SOSL search.

 

http://boards.developerforce.com/t5/Apex-Code-Development/Searching-Text-in-Files-Uploaded-to-CRM-Content/m-p/268753/highlight/false#M46834

Larry LeonidasLarry Leonidas

Thanks for linking the other post. We're still trying to figure this one out.