Page 1 of 1
					
				searching for PDF / upload documents
				Posted: Fri Aug 21, 2009 12:32 pm
				by snowy
				Hi guys, I'm developing a site that will be listing historic newsletters in PDF format.  Does anyone know of a way to get these included in a search?  They are currently sitting in a sub folder in uploads.
I've tried a few of the search engines that come up when i google it but not really found anything that seems to work all that well.
Any suggestions?
			 
			
					
				Re: searching for PDF / upload documents
				Posted: Wed Sep 09, 2009 5:23 am
				by jmcgin51
				you want the content of the PDFs to be indexed/searched, or just the file names and/or file descriptions?  Are you using the Uploads module to manage these, or a different module, or an independent script, or what?
			 
			
					
				Re: searching for PDF / upload documents
				Posted: Wed Sep 09, 2009 11:45 am
				by Jean le Chauve
				This solution could be fine for you (in french) : 
http://forum.cmsmadesimple.org/index.ph ... #msg175201
You can use the api of google search. You need a key: 
http://code.google.com/intl/fr-FR/apis/ ... h/key.html 
You have a sandbox here: 
http://code.google.com/apis/ajax/playground/ 
The doc here : 
http://code.google.com/intl/fr-FR/apis/ ... ss_GSearch
To search documents in pdf zoomjeunes: 
Place into the metadata of the page 
Code: Select all
 
{literal}<__script__ src="http://www.google.com/jsapi?key=taCle" type="text/javascript"></__script>
    <__script__ language="Javascript" type="text/javascript">
    //<![CDATA[
    google.load("search", "1");
    function OnLoad() {
      // Create a search control
      var searchControl = new google.search.SearchControl();
      // Add in a full set of searchers
      var siteSearch = new google.search.WebSearch();
      siteSearch.setSiteRestriction("www.zoomjeune.be");
      siteSearch.setQueryAddition("filetype:pdf");
      searchControl.addSearcher(siteSearch);
     
      // Tell the searcher to draw itself and tell it where to attach
      searchControl.draw(document.getElementById("searchcontrol"));
      // Execute an inital search
      searchControl.execute("jeunes");
    }
    google.setOnLoadCallback(OnLoad);
    //]]>
    </__script>{/literal}
And in the content (or template) 
Code: Select all
 
<div id="searchcontrol"> Loading...</ div>
Here's my demo : 
http://www.zoomjeune.be/recherchepdf.html 
I've made an initial search : jeunes
You have all the tools you need to style, etc.. and it's for free.
And work with . Doc,. Xls, images, mp3, videos, etc..