document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /* ... */
  2.  
  3. /**
  4.  * Processes the search results. Filters out unnecessary nodes
  5.  *
  6.  * @return the final search results object
  7.  */
  8. function processResults(nodes, maxResults)
  9. {    
  10.    var results = [],
  11.       added = 0,
  12.       parts,
  13.       item,
  14.       i, j;
  15.    
  16.    for (i = 0, j = nodes.length; i < j && added < maxResults; i++)
  17.    {
  18.       /**
  19.        * For each node we extract the site/container qname path and then
  20.        * let the per-container helper function decide what to do.
  21.        */
  22.       parts = splitQNamePath(nodes[i]);
  23.       if (parts !== null)
  24.       {
  25.          item = getItem(parts[0], parts[1], parts[2], nodes[i]);
  26.          if (item !== null)
  27.          {
  28.             if( nodes[i]["fragments"] ){ item.fragments = nodes[i]["fragments"]; }
  29.             results.push(item);
  30.             added++;
  31.  
  32.             /* ... */
');