issue #0001341 : Random sort mode
This commit is contained in:
parent
5239c18102
commit
b703307f7c
@ -56,7 +56,7 @@ class Ciblage
|
||||
$configuration->sphinx->host,
|
||||
intval($configuration->sphinx->port)
|
||||
);
|
||||
$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED2);
|
||||
$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED);
|
||||
$this->sphinx->ResetFilters();
|
||||
|
||||
//Follow each elements
|
||||
@ -193,7 +193,7 @@ class Ciblage
|
||||
if ( $nbReturn > 0 ) {
|
||||
$limit = $nbReturn;
|
||||
$maxMatches = $nbReturn;
|
||||
//@todo : ramdom offset to display different results
|
||||
$this->sphinx->SetSortMode( SPH_SORT_EXTENDED, '@random' );
|
||||
}
|
||||
|
||||
$this->sphinx->SetLimits(0, $limit, $maxMatches);
|
||||
@ -900,25 +900,6 @@ class Ciblage
|
||||
$req.= '('.implode('|', $valueIn).')';
|
||||
}
|
||||
if ( count($valueEx)>0 ) {
|
||||
/*
|
||||
if (empty($req)) {
|
||||
//Get all NAFs and remove excluded
|
||||
$nafM = new Application_Model_Naf();
|
||||
$sql = $nafM->select()->from($nafM, array('code'))->where('niveau = 5');
|
||||
$allnaf = $nafM->fetchAll($sql)->toArray();
|
||||
$tmp = array();
|
||||
foreach($allnaf as $code => $naf) {
|
||||
$tmp[] = $naf['code'];
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($tmp);
|
||||
$value = array_diff($tmp, $valueEx);
|
||||
$req.= '('.implode('|', $value).')';
|
||||
|
||||
|
||||
} else {
|
||||
//only exclude
|
||||
$req.= ' -('.implode('|', $valueEx).')';
|
||||
}*/
|
||||
if (empty($req)) {
|
||||
$req = 'EX ';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user