/[drupal]/contributions/modules/luceneapi/contrib/luceneapi_node/luceneapi_node.index.inc
ViewVC logotype

Diff of /contributions/modules/luceneapi/contrib/luceneapi_node/luceneapi_node.index.inc

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

revision 1.2, Sun Nov 15 19:22:14 2009 UTC revision 1.3, Mon Nov 16 03:14:34 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: luceneapi_node.index.inc,v 1.1.2.30 2009/11/13 21:54:28 cpliakas Exp $  // $Id: luceneapi_node.index.inc,v 1.2 2009/11/15 19:22:14 cpliakas Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 74  function _luceneapi_node_update_index() Line 74  function _luceneapi_node_update_index()
74      // builds list of node IDs      // builds list of node IDs
75      $nodes = array();      $nodes = array();
76      $result = db_query_range($sql, $params, 0, $limit);      $result = db_query_range($sql, $params, 0, $limit);
77      while ($node = db_fetch_object($result)) {      foreach ($result as $row) {
78        $nodes[$node->nid] = $node->last_change;        $nodes[$row->nid] = $row->last_change;
79      }      }
80    
81      // if there are nodes to be indexed, indexes      // if there are nodes to be indexed, indexes
# Line 257  function _luceneapi_node_document_add(Ze Line 257  function _luceneapi_node_document_add(Ze
257    
258      //builds array of fields to values      //builds array of fields to values
259      $grants = array();      $grants = array();
260      while ($grant = db_fetch_object($result)) {      foreach ($result as $row) {
261        $field = sprintf('nodeaccess_%s', $grant->realm);        $field = sprintf('nodeaccess_%s', $row->realm);
262        $grants[$field][] = $grant->gid;        $grants[$field][] = $row->gid;
263      }      }
264    
265      // appends grants to the corresponding nodeaccess field      // appends grants to the corresponding nodeaccess field
# Line 323  function _luceneapi_node_batch_set() { Line 323  function _luceneapi_node_batch_set() {
323    // iterates over the nodes, adds batch operation per node    // iterates over the nodes, adds batch operation per node
324    if ($result = db_query($sql)) {    if ($result = db_query($sql)) {
325      $count = 0;      $count = 0;
326      while ($row = db_fetch_object($result)) {      foreach ($result as $row) {
327        $count++;        $count++;
328        $batch['operations'][] = array(        $batch['operations'][] = array(
329          'luceneapi_node_batch', array($row->nid, $row->last_change)          'luceneapi_node_batch', array($row->nid, $row->last_change)

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.2