function __construct($user_query, $type_obj = 'article') { parent::__construct($user_query); $this->type_obj = $type_obj; $this->field_restrict[] = array('field' => 'type', 'values' => $this->type_obj, 'op' => "and", 'not' => false); $this->object_table = 'cms_' . $this->type_obj . 's'; $this->object_key = 'id_' . $this->type_obj; $this->object_index_key = "num_obj"; $this->object_words_table = "cms_editorial_words_global_index"; $this->object_fields_table = "cms_editorial_fields_global_index"; }
protected function _get_sign($sorted = false) { global $typdoc; $sign = parent::_get_sign($sorted); $sign .= md5("&typdoc=" . $typdoc); return $sign; }
protected function _get_pert($return_query = false) { $query = parent::_get_pert(true); if (get_class($this) == get_class()) { // Si cette classe est appelée directement, on cherche dans toutes les autorités donc on va chercher les concepts $searcher_authorities_concepts = new searcher_authorities_concepts($this->user_query); $concepts_pert_result = $searcher_authorities_concepts->get_pert_result(true); if ($concepts_pert_result) { $query = 'select ' . $this->object_key . ', sum(pert) as pert from ((' . $query . ') union all (' . $concepts_pert_result . ')) as search_query_concepts group by ' . $this->object_key; } } if ($return_query) { return $query; } $this->table_tempo = 'search_result' . md5(microtime(true)); $rqt = 'create temporary table ' . $this->table_tempo . ' ' . $query; $res = pmb_mysql_query($rqt, $dbh); pmb_mysql_query('alter table ' . $table . ' add index i_id(' . $this->object_key . ')', $dbh); }