예제 #1
0
 /**
  * Add request settings for Grouping
  *
  * @param Solarium_Query_Select_Component_Grouping $component
  * @param Solarium_Client_Request $request
  * @return Solarium_Client_Request
  */
 public function build($component, $request)
 {
     // enable grouping
     $request->addParam('group', 'true');
     $request->addParam('group.field', $component->getFields());
     $request->addParam('group.query', $component->getQueries());
     $request->addParam('group.limit', $component->getLimit());
     $request->addParam('group.offset', $component->getOffset());
     $request->addParam('group.sort', $component->getSort());
     $request->addParam('group.main', $component->getMainResult());
     $request->addParam('group.ngroups', $component->getNumberOfGroups());
     $request->addParam('group.cache.percent', $component->getCachePercentage());
     $request->addParam('group.truncate', $component->getTruncate());
     return $request;
 }
예제 #2
0
 public function testSetAndGetTruncate()
 {
     $value = true;
     $this->_grouping->setTruncate($value);
     $this->assertEquals($value, $this->_grouping->getTruncate());
 }