r58212 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58211‎ | r58212 | r58213 >
Date:20:41, 27 October 2009
Author:maxsem
Status:deferred
Tags:
Comment:
Retrieve fulltext search capabilities
Modified paths:
  • /branches/sqlite/includes/db/DatabaseSqlite.php (modified) (history)

Diff [purge]

Index: branches/sqlite/includes/db/DatabaseSqlite.php
@@ -97,6 +97,20 @@
9898 }
9999
100100 /**
 101+ * Returns version of currently supported SQLite fulltext search module or false if none present.
 102+ * @return String
 103+ */
 104+ function fulltextSearchEngine() {
 105+ $table = 'dummy_search_test';
 106+ $this->query( "DROP TABLE IF EXISTS $table", __METHOD__ );
 107+ if ( $this->query( "CREATE VIRTUAL TABLE $table USING FTS3(dummy_field)", __METHOD__, true ) ) {
 108+ $this->query( "DROP TABLE IF EXISTS $table", __METHOD__ );
 109+ return 'FTS3';
 110+ }
 111+ return false;
 112+ }
 113+
 114+ /**
101115 * SQLite doesn't allow buffered results or data seeking etc, so we'll use fetchAll as the result
102116 */
103117 function doQuery( $sql ) {
@@ -460,7 +474,7 @@
461475 }
462476
463477 public function getSearchEngine() {
464 - return "SearchEngineDummy";
 478+ return "SearchEngineSqlite";
465479 }
466480
467481 /**

Status & tagging log