/[drupal]/contributions/modules/apachesolr/apachesolr.module
ViewVC logotype

Diff of /contributions/modules/apachesolr/apachesolr.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.12.2.155.2.37 by robertDouglass, Fri Nov 20 11:37:36 2009 UTC revision 1.1.2.12.2.155.2.38 by robertDouglass, Fri Nov 20 14:27:08 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: apachesolr.module,v 1.1.2.12.2.155.2.36 2009/11/20 11:11:03 robertDouglass Exp $  // $Id: apachesolr.module,v 1.1.2.12.2.155.2.37 2009/11/20 11:37:36 robertDouglass Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 349  function apachesolr_index_nodes($rows, $ Line 349  function apachesolr_index_nodes($rows, $
349    $callbacks = array_filter($callbacks, 'function_exists');    $callbacks = array_filter($callbacks, 'function_exists');
350    
351    foreach ($rows as $row) {    foreach ($rows as $row) {
352      // Variables to track the last item changed.      try {
353      $position['last_change'] = $row->changed;        // Build node. Set reset = TRUE to avoid static caching of all nodes that get indexed.
354      $position['last_nid'] = $row->nid;        if ($node = node_load($row->nid, NULL, TRUE)) {
355      // Build node. Set reset = TRUE to avoid static caching of all nodes that get indexed.          foreach ($callbacks as $callback) {
356      if ($node = node_load($row->nid, NULL, TRUE)) {            // The callback can either return a $document or an array of $documents.
357        foreach ($callbacks as $callback) {            $documents[] = $callback($node, $namespace);
358          // The callback can either return a $document or an array of $documents.          }
         $documents[] = $callback($node, $namespace);  
359        }        }
360          // Variables to track the last item changed.
361          $position['last_change'] = $row->changed;
362          $position['last_nid'] = $row->nid;
363        }
364        catch (Exception $e) {
365          // Something bad happened - don't continue.
366          watchdog('Apache Solr', 'Error constructing documents to index: <br /> !message', array('!message' => nl2br(strip_tags($e->getMessage()))), WATCHDOG_ERROR);
367          break;
368      }      }
369    }    }
370    

Legend:
Removed from v.1.1.2.12.2.155.2.37  
changed lines
  Added in v.1.1.2.12.2.155.2.38

  ViewVC Help
Powered by ViewVC 1.1.3