| 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 |
| 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 |
| 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 |
| 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) |