function tripal_pub_AGL_count
2.x tripal_pub.AGL.inc | tripal_pub_AGL_count($yazc, $search_str) |
3.x tripal_chado.pub_importer_AGL.inc | tripal_pub_AGL_count( |
1.x AGL.inc | tripal_pub_AGL_count($search_array) |
1 string reference to 'tripal_pub_AGL_count'
- tripal_pub_remote_search_AGL in tripal_pub/
includes/ importers/ AGL.inc
File
- tripal_pub/
includes/ importers/ AGL.inc, line 362
Code
function tripal_pub_AGL_count($search_array) {
$search_str = $search_array['search_string'];
$days = $search_array['days'];
$limit = $search_array['limit'];
$yazc = $_SESSION['tripal_pub_AGL_query'][$search_str]['yaz_connection'];
//yaz_sort($yazc, "1=31 id"); // sort by publication date descending
if (!yaz_search($yazc, "rpn", $search_str)) {
$error_no = yaz_errno($yazc);
$error_msg = yaz_error($yazc);
$additional = yaz_addinfo($yazc);
if ($additional != $error_msg) {
$error_msg .= " $additional";
}
drupal_set_message("ERROR preparing search at AGL: ($error_no) $error_msg", "error");
watchdog('tpub_import', "ERROR preparing search at AGL: (%error_no) %error_msg",
array('%error_no' => $error_no, '%error_msg' => $error_msg), WATCHDOG_ERROR);
return 0;
}
if (!yaz_wait()) {
$error_no = yaz_errno($yazc);
$error_msg = yaz_error($yazc);
$additional = yaz_addinfo($yazc);
if ($additional != $error_msg) {
$error_msg .= " $additional";
}
drupal_set_message("ERROR waiting on search at AGL: ($error_no) $error_msg", "error");
watchdog('tpub_import', "ERROR waiting on search at AGL: (%error_no) %error_msg",
array('%error_no' => $error_no, '%error_msg' => $error_msg), WATCHDOG_ERROR);
return 0;
}
// get the total number of results from the serach
$count = yaz_hits($yazc);
$_SESSION['tripal_pub_AGL_query'][$search_str]['Count'] = $count;
return $count;
}