diff --git a/FEATURES/80530 b/FEATURES/80530 index 73db27524c011777fae1112e807f463781ce1226..52ad459c5d31019b7a0795a3d1d1ec88f2f2f4c5 100644 --- a/FEATURES/80530 +++ b/FEATURES/80530 @@ -1,6 +1,6 @@ '80530' => ['Label' => $this->_('Possibilité d\'indexer tout champ unimarc pour la recherche simple'), - 'Desc' => '', + 'Desc' => $this->_('Bokeh peut indexer le contenu de n'importe quelle zone unimarc pour la recherche simple plein texte'), 'Image' => '', 'Video' => '', 'Category' => $this->_('Recherche'), diff --git a/library/Class/MoteurRecherche.php b/library/Class/MoteurRecherche.php index 4df0c3f59a27ae29eeeeb6c65844d746c0016910..b92dd84ecfd2779825ef23256b16d07a64d2007a 100644 --- a/library/Class/MoteurRecherche.php +++ b/library/Class/MoteurRecherche.php @@ -149,24 +149,23 @@ class Class_MoteurRecherche { } $axes = ['titres', 'auteurs', 'editeur', 'collection', 'matieres', 'dewey']; - $match_weights = ['titres' => '1.5', - 'auteurs' => '1']; if (trim(Class_CosmoVar::get('other_index_fields'))) $axes []= 'other_terms'; $this->setCondition('MATCH(' . implode(', ', $axes) . ')' . $against); - if (!($tri and $tri != '*' and !$pertinence)) { - $against_titre = $terms->asSelectAgainst(); - $match_weights_string = []; - foreach($match_weights as $axe => $weight) { - $match_weights_string []= 'MATCH(' . $axe . ') ' . $against_titre . ( $weight === '1' ? '' :' * ' . $weight); - } + if (($tri and $tri !== '*') and !$pertinence) + return; - $this->order_by = 'order by (' . implode(') + (', $match_weights_string) . ') desc'; - } + $against_titre = $terms->asSelectAgainst(); + + $match_weights = ['titres' => '1.5', 'auteurs' => '1']; + $match_weights_string = []; + foreach($match_weights as $axe => $weight) + $match_weights_string []= 'MATCH(' . $axe . ') ' . $against_titre . ( $weight === '1' ? '' :' * ' . $weight); + $this->order_by = 'order by (' . implode(') + (', $match_weights_string) . ') desc'; } diff --git a/library/Class/NoticeUnimarc.php b/library/Class/NoticeUnimarc.php index 73c704743e7702d30a898e7daf991ee653deec0d..85dcfdf4b402ba22a87d18af3b30bcd37743866c 100644 --- a/library/Class/NoticeUnimarc.php +++ b/library/Class/NoticeUnimarc.php @@ -234,7 +234,4 @@ class Class_NoticeUnimarc { return implode(' ', $datas); } - } - -?> diff --git a/scripts/reindex_local_unimarc.php b/scripts/reindex_local_unimarc.php index c393718f6d655df3491d96e87c6d1bd96cbfb4d1..de3ed3af92e18d1a62b03404cb925e1cd4cefc5e 100644 --- a/scripts/reindex_local_unimarc.php +++ b/scripts/reindex_local_unimarc.php @@ -3,7 +3,7 @@ error_reporting(E_ERROR | E_PARSE); require(__DIR__.'/../console.php'); -echo "\n\nWelcome to the iReindex Other Terms 2000 X tool by @lla & @patbator\n\n"; +echo "\n\nWelcome to the iReindex Other Terms 2000 X tool by @lla & @patbator, proudly RTed by @ghislo \n\n"; $page = 1; $other_index_fields = Class_CosmoVar::getAsFields('other_index_fields');