diff --git a/VERSIONS_HOTLINE/122140 b/VERSIONS_HOTLINE/122140 new file mode 100644 index 0000000000000000000000000000000000000000..be7875625064650a438f2f804eed814f9ba9dc84 --- /dev/null +++ b/VERSIONS_HOTLINE/122140 @@ -0,0 +1 @@ + - ticket #122140 : Recherche avancée : suite à la correction de l'indexation des éditeurs (#118258), la recherche avancée sur ce champ pouvait ne pas aboutir. Correction de la recherche fulltext sur ce champ \ No newline at end of file diff --git a/library/Class/MoteurRecherche.php b/library/Class/MoteurRecherche.php index 987facc764416c3f16a6bfd390dfe4a9c7db15fb..5326e337e1d4006745813fc94dbfdc5e057a15b1 100644 --- a/library/Class/MoteurRecherche.php +++ b/library/Class/MoteurRecherche.php @@ -214,11 +214,14 @@ class Class_MoteurRecherche { $this->setCondition("annee <='" . $annee_fin . "'"); } + public function visitEditor($editor) { - $this->setCondition("editeur like '%" . str_replace('\'','%',$editor) . "%'"); + $this->setCondition(sprintf('MATCH(editeur) AGAINST(\'%s\' IN BOOLEAN MODE)', + $this->ix->alphaMaj($editor))); } + public function visitCoteDebutFin($cote_debut, $cote_fin) { if ($cote_debut) $this->setCondition(" cote >='" . strtoupper($cote_debut) . "'"); diff --git a/tests/library/Class/MoteurRechercheTest.php b/tests/library/Class/MoteurRechercheTest.php index 488ff82bc2bbc344182b9357ddf35e45cee4fa2a..00425273e1d82c84c451135cbdc89f625607e8cf 100644 --- a/tests/library/Class/MoteurRechercheTest.php +++ b/tests/library/Class/MoteurRechercheTest.php @@ -162,8 +162,8 @@ class MoteurRechercheAvanceeTest extends MoteurRechercheTestCase { 'nouveaute' => '3', 'type_recherche' => 'nimportequoi', 'pertinence' => false, - 'tri' => 'alpha_titre'] , - 'req_notices' => $this->listSqlWith("editeur like '%Raisons d%agir%' and date_creation >'2012-02-03' and (MATCH(titres) AGAINST('+(NOUVEAU NOUVEAUX NOUVO) +(CHIEN CHIENS CHIN) +(GARDE GARDES GARD)' IN BOOLEAN MODE)) and MATCH(facettes) AGAINST('+(B4)' IN BOOLEAN MODE)", + 'tri' => 'alpha_titre'], + 'req_notices' => $this->listSqlWith("MATCH(editeur) AGAINST('RAISONS D AGIR' IN BOOLEAN MODE) and date_creation >'2012-02-03' and (MATCH(titres) AGAINST('+(NOUVEAU NOUVEAUX NOUVO) +(CHIEN CHIENS CHIN) +(GARDE GARDES GARD)' IN BOOLEAN MODE)) and MATCH(facettes) AGAINST('+(B4)' IN BOOLEAN MODE)", 'alpha_titre')], [['rech_auteurs' => 'Stiegler',