Skip to content
Snippets Groups Projects
Commit 23f65bcd authored by jgaimard's avatar jgaimard
Browse files

Correction moteur de recherche pour poids sur mots en forme exacte

parent f4b2ccd0
Branches
Tags
No related merge requests found
......@@ -71,7 +71,9 @@ class Class_MoteurRecherche {
$recherche = '';
if (!$mode_isbn = $this->createReqForIsbn($expression)) {
$mots = $this->ix->getMots($expression);
foreach ($mots as $mot) {
foreach ($mots as $mot)
{
$against_titre.=" ".$mot;
$mot = $this->ix->getExpressionRecherche($mot);
if ($mot) {
$this->nb_mots++;
......@@ -98,11 +100,12 @@ class Class_MoteurRecherche {
if (! ($tri and $tri!="*" and !$pertinence or $mode_isbn==true)) {
$filtre_against=str_replace("+"," ",$against);
$filtre_against=str_replace("IN BOOLEAN MODE","",$filtre_against);
$this->select_notices="id_notice,MATCH(alpha_titre) ".$filtre_against." as rel1, ";
$this->select_notices.="MATCH(alpha_auteur)".$filtre_against." as rel2 ";
//$filtre_against=str_replace("+"," ",$against);
//$filtre_against=str_replace("IN BOOLEAN MODE","",$filtre_against);
$this->select_notices="id_notice,MATCH(alpha_titre) AGAINST('".$against_titre."') as rel1, ";
$this->select_notices.="MATCH(alpha_auteur)AGAINST('".$against_titre."') as rel2 ";
$this->select_notices.="from notices ";
//$this->order_by=" order by (rel1 * 1.5)+(rel2) desc";
$this->order_by=" order by (rel1 * 1.5)+(rel2) desc";
}
}
......@@ -282,6 +285,8 @@ class Class_MoteurRecherche {
$ret["req_facettes"]=$req_facettes;
$ret['nb_mots'] = $this->nb_mots;
//tracedebug($req_notices);
return $ret;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment