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
samrat.1985@lntinfotechsamrat.1985@lntinfotech 

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.

 

Pradeep_NavatarPradeep_Navatar

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 >

                                                <script>

                                                function doSearch()

                                                {

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

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

                                                }

                                                </script>

                                                <input/>

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

                                                </apex:form>

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

                                                 </apex:pageBlock>

                                                </apex:page>

samrat.1985@lntinfotechsamrat.1985@lntinfotech

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

Hari@RockzsHari@Rockzs

Hi Pradeep

 

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

samrat.1985@lntinfotechsamrat.1985@lntinfotech

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.