Author: david
Date: Wed Oct 21 14:15:11 2009
New Revision: 3789
Log:
Reverse merge r3763.
Modified:
trunk/apps/qubit/modules/informationobject/actions/listAction.class.php
Modified:
trunk/apps/qubit/modules/informationobject/actions/listAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/listAction.class.php
Wed Oct 21 13:58:32 2009 (r3788)
+++ trunk/apps/qubit/modules/informationobject/actions/listAction.class.php
Wed Oct 21 14:15:11 2009 (r3789)
@@ -127,28 +127,18 @@
}
}
- // Do search
- $results = $search->getEngine()->getIndex()->find($query);
+ $this->pager = new QubitSearchPager;
+ $this->pager->hits = $search->getEngine()->getIndex()->find($query);
+ $this->pager->setPage($request->page);
- // Loop through results and get a list of unique ids because orignial
- // search may return a hit for each culture of info object
- $uniqueIds = array();
- foreach ($results as $result)
+ $ids = array();
+ foreach ($this->pager->getResults() as $hit)
{
- if (!in_array(($id = $result->getDocument()->id), $uniqueIds))
- {
- $uniqueIds[] = $id;
- }
+ $ids[] = $hit->getDocument()->id;
}
- // Paginate
- $this->pager = new QubitSearchPager;
- $this->pager->hits = $uniqueIds;
- $this->pager->setPage($request->page);
-
- // Get ORM objects for display
$criteria = new Criteria;
- $criteria->add(QubitInformationObject::ID, $this->pager->getResults(),
Criteria::IN);
+ $criteria->add(QubitInformationObject::ID, $ids, Criteria::IN);
$this->informationObjects = QubitInformationObject::get($criteria);
}
}
--~--~---------~--~----~------------~-------~--~----~
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.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---