0) { foreach ($results as $key => $row) { $results_by_tool[$row['toolid']][] = $row; } $processed_results = []; foreach ($results_by_tool as $toolid => $rows) { $tool_processor_class = $toolid.'_processor'; $tool_processor_path = api_get_path(LIBRARY_PATH).'search/tool_processors/'.$tool_processor_class.'.class.php'; if (file_exists($tool_processor_path)) { require_once $tool_processor_path; $tool_processor = new $tool_processor_class($rows); $processed_results = array_merge($tool_processor->process(), $processed_results); } } return [count($processed_results), $processed_results]; } } /** * Wrapper for join xapian queries. * * @param XapianQuery|array $query1 * @param XapianQuery|array $query2 * @param string $op * * @return XapianQuery query joined */ function chamilo_join_queries($query1, $query2 = null, $op = 'or') { return xapian_join_queries($query1, $query2, $op); }