$api1->bingApi($query2, $_SESSION['results'], $offset); // Set BING JSON Data $formatter1->setBingJson($api1->returnBingJsonData(), $api1->returnBingJsonResultFlag()); $formatter1->formatBingJson($_SESSION['results'], $i * 50); } // Blekko Results $api1->blekkoApi($query3, $_SESSION['results'], 0); // Set BLEKKO JSON Data $formatter1->setBlekkoJson($api1->returnBlekkoJsonData(), $api1->returnBlekkoJsonResultFlag()); $formatter1->formatBlekkoJson($_SESSION['results'], 0); // Instantate Aggregator $aggregator1 = new aggregator(new resultSet()); // Send result sets 1,2 & 3 to Data Fusion Function $aggregator1->dataFusion($api1->returnGoogleJsonResultFlag(), $api1->returnBingJsonResultFlag(), $api1->returnBlekkoJsonResultFlag(), $formatter1->returnResultSet('resultSet1'), $formatter1->returnResultSet('resultSet2'), $formatter1->returnResultSet('resultSet3')); // Print Agg Results $aggregator1->printResultSetAgg(); // Query Timer $time_post = microtime(true); $exec_time = $time_post - $time_pre; echo '</br>Query Time: ' . $exec_time; // Print Results to file - for metrics //$aggregator1->outputResultSetToFile('Aggregated', 'resultSetAgg', $_SESSION['results']); //$formatter1->outputResultSetToFile('Google', 'resultSet1', $_SESSION['results']); //$formatter1->outputResultSetToFile('Bing', 'resultSet2', $_SESSION['results']); //$formatter1->outputResultSetToFile('Blekko', 'resultSet3', $_SESSION['results']); } else { if ($_SESSION['result_op'] == 'nonAgg') { // Instantiate a new API $api1 = new api(); // Instantiate a new formatter with the 3 result sets as properties $formatter1 = new formatter(new resultSet(), new resultSet(), new resultSet());