This commit is contained in:
Michael RICOIS 2012-05-10 09:24:05 +00:00
parent fb3ecd7321
commit ccd2641ab3

View File

@ -4,14 +4,11 @@ require_once 'sphinxapi/sphinxapi-2.0.4.php';
Class Ciblage
{
private $sphinx;
private $alpha = '';
private $presentRcs = 0;
protected $sphinx;
protected $alpha = '';
protected $presentRcs = 0;
public $index = 'ciblage';
public $nb_results = 5000;
public $max_results = 500000;
protected $index = 'ciblage';
public $sphinx_match = SPH_MATCH_EXTENDED2;
public $sphinx_sort = SPH_SORT_EXTENDED;
@ -86,6 +83,7 @@ Class Ciblage
}
public function execute($need = false, $limitD = false)
{
Zend_Registry::get('firebug')->info("Sphinx : ");
if($need) {
$return = array();
$limit = 0;
@ -97,8 +95,12 @@ Class Ciblage
$limit = $limit + 1000;
}while($limit < (($limitD!=false)?10:$resSphinx['total_found']));
return ($return);
} else
} else {
$this->sphinx->SetLimits(0, 1);
$resSphinx = $this->sphinx->Query($this->alpha, $this->index);
}
Zend_Registry::get('firebug')->info($resSphinx);
return ($resSphinx['total_found']);
}
protected function setFilter($name, $valeur, $ex = false) {