title: Search Google Drive folder from Google Site using Apps Script
body: <p>I have made a Google Site that contains a lot of Google Drive folders.
  Whenever I do a search using the Google Sites search thing, I can only find words that are one the Google Site. So the Google Drive Folders are not included in the search results.</p>
  
  <p>Anyway, <a href="https://sites.google.com/site/scriptsexamples/learn-by-example/other-examples/advanced-search-on-google-sites" rel="nofollow">I was looking on the web and I came across this piece of code:</a></p>
  
  <pre><code>function doGet(e) {
    var results = DriveApp.getFolderById('File ID').searchFiles('fullText contains "' + e.parameter.q + '"');
    var app = UiApp.createApplication();
    var panel = app.createVerticalPanel();
  
    while(results.hasNext()) {
      var file = results.next();
      panel.add(app.createAnchor(file.getName(), file.getUrl()));
    }
  
    var scrollPanel = app.createScrollPanel(panel).setHeight(800);
    app.add(scrollPanel);
    return app;
  }
  </code></pre>
  
  <p>I can get this script up and running using Google Search Appliance in the Google Site. 
  (link:<a href="https://sites.google.com/a/sgmeulebekepittem.be/testminerva" rel="nofollow">Google Site with changed Searchbutton. (script is embedded in page: zoeken ==> just add "/zoeken" to the url.)</a>
  However, everytime I do a search, I get a TypeError. Is there anybody who is able to correct the script above or knows a piece of code that will allow me to search a Google Drive folder from a Google Site? Any help would be muchly appreciated.</p>