$user_id = $q->field(0, 'user_id'); $registered++; } else { $user_id = 0; $unregistered++; } mlog("\nEMAIL: {$email}, uid {$user_id}; memory usage : " . memory_get_usage() . "\n"); } $data = null; if (!isset($results[$criteria_batch])) { mlog(" ALERT {$active}/{$outof} QUERY {$queries} : Xapian query '{$criteria_batch}'"); $start = getmicrotime(); $SEARCHENGINE = new SEARCHENGINE($criteria_batch); #mlog("query_remade: " . $SEARCHENGINE->query_remade() . "\n"); $args = array('s' => $criteria_raw, 'threshold' => $lastupdated, 'o' => 'c', 'num' => 1000, 'pop' => 1, 'e' => 1); $data = $DEBATELIST->_get_data_by_search($args); # add to cache (but only for speaker queries, which are commonly repeated) if (preg_match('#^speaker:\\d+$#', $criteria_raw, $m)) { mlog(", caching"); $results[$criteria_batch] = $data; } # unset($SEARCHENGINE); $total_results = $data['info']['total_results']; $queries++; mlog(", hits " . $total_results . ", time " . (getmicrotime() - $start) . "\n"); } else { mlog(" ACTION {$active}/{$outof} CACHE HIT : Using cached result for '{$criteria_batch}'\n"); $data = $results[$criteria_batch]; } if (isset($data['rows']) && count($data['rows']) > 0) { usort($data['rows'], 'sort_by_stuff');