Skip to content
Snippets Groups Projects
Commit 8aa63a0d authored by Laurent's avatar Laurent
Browse files

refactoring of facets & tags rendering (more readability and speed)

parent c6dd094e
Branches
Tags
2 merge requests!1132Hotline#29412 images des articles dans le resultat de recherche,!1065Hotline#28822 search speed
......@@ -47,7 +47,7 @@ class Class_MoteurRecherche_Facettes {
"nombre" => $preferences["tags_nombre"]);
if(!$p_facette["actif"] and !$p_tag["actif"])
return $result;
return $result;
// Lecture des notices
$codes_count = $this->fetchFacetsRows($req);
......@@ -65,14 +65,12 @@ class Class_MoteurRecherche_Facettes {
public function fetchFacetsRows($req) {
$all = [];
array_map(
function($row) use (&$all){
$all = array_merge($all,
explode(' ', $row['facettes']));
},
Zend_Registry::get('sql')->fetchAll($req));
$all = array_count_values(array_filter($all));
$all = array_count_values(
array_filter(
explode(' ',
implode(' ',
array_column(Zend_Registry::get('sql')->fetchAll($req),
'facettes')))));
arsort($all);
return $all;
}
......
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