Merge "Ignore height as well as width for framed images."
[lhc/web/wiklou.git] / includes / search / SearchSqlite.php
index 554181f..6b2b3c6 100644 (file)
  * Search engine hook for SQLite
  * @ingroup Search
  */
-class SearchSqlite extends SearchEngine {
-
-       /**
-        * @var DatabaseSqlite
-        */
-       protected $db;
-
-       /**
-        * Creates an instance of this class
-        * @param $db DatabaseSqlite: database object
-        */
-       function __construct( $db ) {
-               parent::__construct( $db );
-       }
-
+class SearchSqlite extends SearchDatabase {
        /**
         * Whether fulltext search is supported by current schema
         * @return Boolean
@@ -198,18 +184,6 @@ class SearchSqlite extends SearchEngine {
                return new SqliteSearchResultSet( $resultSet, $this->searchTerms, $total );
        }
 
-       /**
-        * Return a partial WHERE clause to exclude redirects, if so set
-        * @return String
-        */
-       function queryRedirect() {
-               if ( $this->showRedirects ) {
-                       return '';
-               } else {
-                       return 'AND page_is_redirect=0';
-               }
-       }
-
        /**
         * Return a partial WHERE clause to limit the search to the given namespaces
         * @return String
@@ -245,7 +219,6 @@ class SearchSqlite extends SearchEngine {
        function getQuery( $filteredTerm, $fulltext ) {
                return $this->limitResult(
                        $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
-                       $this->queryRedirect() . ' ' .
                        $this->queryNamespaces()
                );
        }
@@ -281,8 +254,7 @@ class SearchSqlite extends SearchEngine {
                $searchindex = $this->db->tableName( 'searchindex' );
                return "SELECT COUNT(*) AS c " .
                        "FROM $page,$searchindex " .
-                       "WHERE page_id=$searchindex.rowid AND $match" .
-                       $this->queryRedirect() . ' ' .
+                       "WHERE page_id=$searchindex.rowid AND $match " .
                        $this->queryNamespaces();
        }