diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
commit | 9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch) | |
tree | 46d1a0dee7febef5c2d57a9f7b972be16a163b3d /includes/search/SearchOracle.php | |
parent | 78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff) |
update to MediaWiki 1.17.0
Diffstat (limited to 'includes/search/SearchOracle.php')
-rw-r--r-- | includes/search/SearchOracle.php | 62 |
1 files changed, 38 insertions, 24 deletions
diff --git a/includes/search/SearchOracle.php b/includes/search/SearchOracle.php index e4c5deee..15c386ce 100644 --- a/includes/search/SearchOracle.php +++ b/includes/search/SearchOracle.php @@ -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); |