function update_cache() { global $dbh; if (!isset($this->config["search"])) { $this->config["search"] = ""; } //On ne va pas chercher à effectuer une recherche vide if (!$this->config["search"]) { return; } //on marque le set comme en cours de rafraichissement $query = "update connectors_out_sets set being_refreshed = 1 where connector_out_set_id = " . $this->id; pmb_mysql_query($query, $dbh); //Utilisons la classe de caches de recherche pour effectuer la recherche. $cache_duration = $this->cache->cache_duration_in_seconds(); $es_search_cache = new external_services_searchcache('search_fields', '', -1, -1, $cache_duration, 'conset', true); $es_search_cache->unserialize_search($this->config["search"]); $es_search_cache->update(); $values = $es_search_cache->get_results(0, $es_search_cache->get_result_count(false), '', false); $this->cache->values = $values; $this->cache->commit_values_into_db(); //on marque le set comme en cours de rafraichissement $query = "update connectors_out_sets set being_refreshed = 0 where connector_out_set_id = " . $this->id; pmb_mysql_query($query, $dbh); }
function fetchSearchRecordsFullWithBullIdSorted($searchId, $firstRecord, $recordCount, $recordCharset = 'iso-8859-1', $includeLinks = true, $includeItems = false, $sort_type = '') { global $dbh; $firstRecord += 0; $recordCount += 0; //Cherchons la session $sql = "SELECT * FROM es_searchsessions WHERE es_searchsession_id = '" . addslashes($searchId) . "'"; $res = mysql_query($sql, $dbh); if (!mysql_numrows($res)) { return array(); } $row = mysql_fetch_assoc($res); $this->update_session_date($searchId); $search_unique_id = $row["es_searchsession_searchnum"]; $search_realm = $row["es_searchsession_searchrealm"]; $pmbuserid = $row["es_searchsession_pmbuserid"]; $opacemprid = $row["es_searchsession_opacemprid"]; if (!$search_unique_id) { return array(); } $search_cache = new external_services_searchcache($search_realm, $search_unique_id, $pmbuserid, $opacemprid); $notice_ids = $search_cache->get_results($firstRecord, $recordCount, $sort_type); $records = $this->proxy_parent->pmbesNotices_fetchNoticeListFullWithBullId($notice_ids, "raw_array_assoc", $recordCharset, $includeLinks, $includeItems); return $records; $array_results = array_values($records); return $array_results; }