searching for PDF / upload documents

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
snowy
New Member
New Member
Posts: 5
Joined: Tue Jun 30, 2009 6:24 pm

searching for PDF / upload documents

Post 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?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: searching for PDF / upload documents

Post 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?
Jean le Chauve

Re: searching for PDF / upload documents

Post 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..
Post Reply

Return to “The Lounge”