]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - includes/search/SearchOracle.php
MediaWiki 1.17.0
[autoinstalls/mediawiki.git] / includes / search / SearchOracle.php
index e4c5deee55ef7b388e29a662e398a2a46c16e961..15c386ced0e3fcc383468486e52c2fc8aaecfd1d 100644 (file)
@@ -1,23 +1,25 @@
 <?php
-# Copyright (C) 2004 Brion Vibber <brion@pobox.com>
-# http://www.mediawiki.org/
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-# http://www.gnu.org/copyleft/gpl.html
-
 /**
+ * Oracle search engine
+ *
+ * Copyright © 2004 Brion Vibber <brion@pobox.com>
+ * http://www.mediawiki.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
  * @file
  * @ingroup Search
  */
@@ -54,9 +56,13 @@ class SearchOracle extends SearchEngine {
                                                                        'TRSYN' => 1, 
                                                                        'TT' => 1, 
                                                                        'WITHIN' => 1);
-       
+
+       /**
+        * Creates an instance of this class
+        * @param $db DatabasePostgres: database object
+        */
        function __construct($db) {
-               $this->db = $db;
+               parent::__construct( $db );
        }
 
        /**
@@ -240,16 +246,24 @@ class SearchOracle extends SearchEngine {
                                'si_title' => $title,
                                'si_text' => $text
                        ), 'SearchOracle::update' );
-               $dbw->query("CALL ctx_ddl.sync_index('si_text_idx')");
-               $dbw->query("CALL ctx_ddl.sync_index('si_title_idx')");
+
+               // Sync the index
+               // We need to specify the DB name (i.e. user/schema) here so that 
+               // it can work from the installer, where
+               //     ALTER SESSION SET CURRENT_SCHEMA = ...
+               // was used.
+               $dbw->query( "CALL ctx_ddl.sync_index(" . 
+                       $dbw->addQuotes( $dbw->getDBname() . '.' . trim( $dbw->tableName( 'si_text_idx' ),  '"' ) ) . ")" );
+               $dbw->query( "CALL ctx_ddl.sync_index(" . 
+                       $dbw->addQuotes( $dbw->getDBname() . '.' . trim( $dbw->tableName( 'si_title_idx' ),  '"' ) ) . ")" );
        }
 
        /**
         * Update a search index record's title only.
         * Title should be pre-processed.
         *
-        * @param int $id
-        * @param string $title
+        * @param $id Integer
+        * @param $title String
         */
        function updateTitle($id, $title) {
                $dbw = wfGetDB(DB_MASTER);