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

Search in Documents

I want to implement document search in Salesforce. I want my code to crawl withn salesforce and  bring the document search result.

Documents will be mostly pdf now. M looking forward for some ideas.



Create a controller and VF page. From the VF page send the searching document name as parameter of ActionFunction and rerender the section on that you are going to show the result and in controller query the data using LIKE clause. If it returns any record then show it otherwise display some custom message that no such document exist.


Also tryout a workaround for document search :


                                                <apex:page showHeader="false" sidebar="false">

                                                <apex:pageBlock >

                                                <b>Enter search term: </b>

                                                <apex:form >


                                                function doSearch()


                                                                var searchStr = document.getElementById('txtSearch').value;

                                                      '/_ui/common/search/client/ui/UnifiedSearchResults?sen=001&sen=015&str=' + encodeURIComponent(searchStr), "_parent" );




                                                <input value="Go!" id="btnSearch"/>


                                                (<strong>NOTE:</strong> Only searches Accounts and document)




Thanks...would really help if u can put up a sample code


Hi Pradeep


Can u elabrate more,we r  also working on content us to get search from documents


Well here is the scenario

we have documents stored in AmazonS3 and salesforce as well. we want our search to crawl through all the doc both within and outside the Salesforce and bring back appropriate search result.

How can this be made possible is the question here. Because as far as i am aware of Salesforce search it doesnot crawl the documents to retireve the search result.

If we can achieve this it will be great.