* Misc :
- #65: broken links. -MC
+
+ * Search :
+ - #249, #251, #253 : some tweaks to be more accurate. -MC
* Validations :
- #137: now possible to add comments without any action. -MC
LEFT JOIN watch_nonins AS w ON (w.ni_id=u.user_id AND w.uid='.Session::getInt('uid').')
'.$globals->search->result_where_statement.'
WHERE '.$fields->get_where_statement().'
- HAVING mark>=10
+ HAVING mark>0
ORDER BY '.(logged() && Env::has('mod_date_sort') ? 'date DESC,' :'')
.implode(',',array_filter(array($fields->get_order_statement(), 'u.promo DESC, NomSortKey, prenom'))).'
LIMIT '.$offset->value.','.$globals->search->per_page;
return "10 AS mark";
}
$order = "0";
+ $sep = "[ \\'\\-]";
foreach ($this->strings as $s) {
- $order .= " + ( (u.nom='$s' OR u.epouse='$s') + (CONCAT(' ',u.nom,' ',u.epouse,' ') RLIKE '[ \\-]{$s}[ \\-]') )*100
- + ( u.nom LIKE '$s%' OR u.epouse LIKE '$s%' )*10
- + ( u.prenom LIKE '$s%' OR u.prenom LIKE '% $s%' OR u.prenom LIKE '%-$s%' )";
+ $order .= " + ( (u.nom='$s' OR u.epouse='$s') + (CONCAT(' ',u.nom,' ',u.epouse,' ') RLIKE '$sep{$s}$sep') )*1000
+ + ( CONCAT(' ',u.nom,' ',u.epouse,' ') RLIKE '$sep{$s}' )*100
+ + ( (u.prenom = '$s') + (CONCAT(' ',u.prenom,' ') RLIKE '$sep{$s}$sep') )*10
+ + ( u.prenom RLIKE '$sep{$s}' )";
}
return $order.' AS mark';
}