Author: david
Date: Tue Jul 12 14:17:40 2011
New Revision: 9304
Log:
Fix count of all information objects
Modified:
trunk/lib/search/QubitSearch.class.php
Modified: trunk/lib/search/QubitSearch.class.php
==============================================================================
--- trunk/lib/search/QubitSearch.class.php Tue Jul 12 13:55:19 2011
(r9303)
+++ trunk/lib/search/QubitSearch.class.php Tue Jul 12 14:17:40 2011
(r9304)
@@ -69,6 +69,8 @@
*/
public function qubitPopulate($options)
{
+ $conn = Propel::getConnection();
+
$start = microtime(true);
$this->getLogger()->log('Populating index...', $this->getName());
@@ -119,6 +121,12 @@
// index information objects
if (-1 < $ioOffset)
{
+ // Get count of all information objects
+ $sql = 'SELECT COUNT(*) from '.QubitInformationObject::TABLE_NAME;
+ $rs = $conn->query($sql);
+ $rowcount = $rs->fetchColumn(0);
+
+ // Get info objects (with offset)
$criteria = new Criteria;
QubitInformationObject::addSelectColumns($criteria);
@@ -127,9 +135,9 @@
$criteria->setOffset($ioOffset);
}
- $counter = intval(BasePeer::doCount(clone $criteria)->fetchColumn(0));
$informationObjects = QubitInformationObject::get($criteria);
+ // Loop through results, and add to search index
foreach ($informationObjects as $key => $informationObject)
{
if ($key == 0 && 0 < $ioOffset)
@@ -145,7 +153,7 @@
}
}
- $this->getLogger()->log('"'.$informationObject->__toString().'"
inserted ('.round(microtime(true) - $start, 2).'s) ('.($key + $ioOffset +
1).'/'.$counter.')', $this->getName());
+ $this->getLogger()->log('"'.$informationObject->__toString().'"
inserted ('.round(microtime(true) - $start, 2).'s) ('.($key + $ioOffset +
1).'/'.$rowcount.')', $this->getName());
}
}
else
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.