public function Index()
 {
     AssetLoadManager::register('tableList');
     $vo_dm = Datamodel::load();
     $va_elements = ca_metadata_elements::getRootElementsAsList(null, null, true, true);
     $this->view->setVar('element_list', $va_elements);
     $this->view->setVar('attribute_types', Attribute::getAttributeTypes());
     $o_result_context = new ResultContext($this->request, $this->ops_table_name, 'basic_search');
     $o_result_context->setResultList(array_keys($va_elements));
     $o_result_context->setAsLastFind();
     $o_result_context->saveContext();
     return $this->render('elements_list_html.php');
 }
Exemple #2
0
 public function __construct()
 {
     parent::__construct();
     $this->opo_tep = new TimeExpressionParser();
     $this->ops_lookup_word_sql = "\n\t\t\tSELECT word_id \n\t\t\tFROM ca_sql_search_words\n\t\t\tWHERE\n\t\t\t\tword = ?\n\t\t";
     $this->opqr_lookup_word = $this->opo_db->prepare($this->ops_lookup_word_sql);
     $this->ops_insert_word_index_sql = "\n\t\t\tINSERT  INTO ca_sql_search_word_index\n\t\t\t(table_num, row_id, field_table_num, field_num, field_row_id, word_id, boost, access)\n\t\t\tVALUES\n\t\t";
     $this->ops_insert_word_sql = "\n\t\t\tINSERT  INTO ca_sql_search_words\n\t\t\t(word, stem)\n\t\t\tVALUES\n\t\t\t(?, ?)\n\t\t";
     $this->ops_insert_ngram_sql = "\n\t\t\tINSERT  INTO ca_sql_search_ngrams\n\t\t\t(word_id, ngram, seq)\n\t\t\tVALUES\n\t\t";
     $this->opqr_insert_word = $this->opo_db->prepare($this->ops_insert_word_sql);
     $this->ops_delete_sql = "DELETE FROM ca_sql_search_word_index WHERE (table_num = ?) AND (row_id = ?)";
     $this->opqr_delete = $this->opo_db->prepare($this->ops_delete_sql);
     $this->ops_delete_with_field_num_sql = "DELETE FROM ca_sql_search_word_index WHERE (table_num = ?) AND (row_id = ?) AND (field_table_num = ?) AND (field_num = ?)";
     $this->opqr_delete_with_field_num = $this->opo_db->prepare($this->ops_delete_with_field_num_sql);
     $this->ops_delete_with_field_row_id_sql = "DELETE FROM ca_sql_search_word_index WHERE (table_num = ?) AND (row_id = ?) AND (field_table_num = ?) AND (field_row_id = ?)";
     $this->opqr_delete_with_field_row_id = $this->opo_db->prepare($this->ops_delete_with_field_row_id_sql);
     $this->ops_delete_with_field_row_id_and_num = "DELETE FROM ca_sql_search_word_index WHERE (table_num = ?) AND (row_id = ?) AND (field_table_num = ?) AND (field_num = ?) AND (field_row_id = ?)";
     $this->opqr_delete_with_field_row_id_and_num = $this->opo_db->prepare($this->ops_delete_with_field_row_id_and_num);
     $this->ops_delete_dependent_sql = "DELETE FROM ca_sql_search_word_index WHERE (field_table_num = ?) AND (field_row_id = ?)";
     $this->opqr_delete_dependent_sql = $this->opo_db->prepare($this->ops_delete_dependent_sql);
     $this->opo_stemmer = new SnoballStemmer();
     $this->opb_do_stemming = (int) trim($this->opo_search_config->get('search_sql_search_do_stemming')) ? true : false;
     if (!($this->ops_indexing_tokenizer_regex = trim($this->opo_search_config->get('indexing_tokenizer_regex')))) {
         $this->ops_indexing_tokenizer_regex = "^\\pL\\pN\\pNd/_#\\@\\&\\.";
     }
     if (!($this->ops_search_tokenizer_regex = trim($this->opo_search_config->get('search_tokenizer_regex')))) {
         $this->ops_search_tokenizer_regex = "^\\pL\\pN\\pNd/_#\\@\\&";
     }
     if (!is_array($this->opa_asis_regexes = $this->opo_search_config->getList('asis_regexes'))) {
         $this->opa_asis_regexes = array();
     }
     //$this->opqr_insert_ngram = $this->opo_db->prepare($this->ops_insert_ngram_sql);
     //
     // Load info about metadata elements into static var cache if it hasn't already be fetched
     //
     if (!is_array(WLPlugSearchEngineSqlSearch::$s_metadata_elements)) {
         WLPlugSearchEngineSqlSearch::$s_metadata_elements = ca_metadata_elements::getRootElementsAsList();
     }
     $this->debug = false;
 }
Exemple #3
0
 public function __construct($po_db = null)
 {
     parent::__construct($po_db);
     $this->opo_tep = new TimeExpressionParser();
     $this->opo_stemmer = new SnoballStemmer();
     $this->opb_do_stemming = (int) trim($this->opo_search_config->get('search_sql_search_do_stemming')) ? true : false;
     $this->initDbStatements();
     if (!($this->ops_indexing_tokenizer_regex = trim($this->opo_search_config->get('indexing_tokenizer_regex')))) {
         $this->ops_indexing_tokenizer_regex = "^\\pL\\pN\\pNd/_#\\@\\&\\.";
     }
     if (!($this->ops_search_tokenizer_regex = trim($this->opo_search_config->get('search_tokenizer_regex')))) {
         $this->ops_search_tokenizer_regex = "^\\pL\\pN\\pNd/_#\\@\\&";
     }
     if (!is_array($this->opa_asis_regexes = $this->opo_search_config->getList('asis_regexes'))) {
         $this->opa_asis_regexes = array();
     }
     //
     // Load info about metadata elements into static var cache if it hasn't already be fetched
     //
     if (!is_array(WLPlugSearchEngineSqlSearch::$s_metadata_elements)) {
         WLPlugSearchEngineSqlSearch::$s_metadata_elements = ca_metadata_elements::getRootElementsAsList();
     }
     $this->debug = false;
 }