setGroupBy() 공개 메소드

Set grouping attribute and function
public setGroupBy ( string $attribute, integer $func, string $groupsort = '@group desc' ) : SphinxClient
$attribute string attribute name
$func integer grouping function
$groupsort string group sorting clause
리턴 SphinxClient
예제 #1
0
 public function testUpdateAttributes()
 {
     $sphinx = new SphinxClient();
     $sphinx->setGroupBy('attr1', SphinxClient::SPH_GROUPBY_ATTR);
     $sphinx->updateAttributes('sphinxtest', array('attr1'), array(1 => array(10), 2 => array(10), 3 => array(20), 4 => array(20)));
     $results = $sphinx->query('bb');
     $this->assertEquals($results['total'], 3);
     // restore attributes
     $sphinx->updateAttributes('sphinxtest', array('attr1'), array(1 => array(2), 2 => array(4), 3 => array(1), 4 => array(5)));
 }
 /**
  * {@inheritdoc}
  */
 public function setGroupBy($attribute, $func, $groupsort = '@group desc')
 {
     return $this->proxy->setGroupBy($attribute, $func, $groupsort);
 }