r60884 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60883‎ | r60884 | r60885 >
Date:10:02, 10 January 2010
Author:maxsem
Status:ok
Tags:
Comment:
Cleared SearchSqlite from some mysqlisms from r58322
Modified paths:
  • /trunk/phase3/includes/search/SearchSqlite.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/search/SearchSqlite.php
@@ -26,8 +26,6 @@
2727 * @ingroup Search
2828 */
2929 class SearchSqlite extends SearchEngine {
30 - var $strictMatching = true;
31 -
3230 // Cached because SearchUpdate keeps recreating our class
3331 private static $fulltextSupported = null;
3432
@@ -64,7 +62,6 @@
6563 $searchon = '';
6664 $this->searchTerms = array();
6765
68 - # FIXME: This doesn't handle parenthetical expressions.
6966 $m = array();
7067 if( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
7168 $filteredText, $m, PREG_SET_ORDER ) ) {
@@ -78,13 +75,9 @@
7976 $term = str_replace( '"', '', $term );
8077 $quote = '"';
8178 }
82 -
 79+
8380 if( $searchon !== '' ) $searchon .= ' ';
84 - if( $this->strictMatching && ($modifier == '') ) {
85 - // If we leave this out, boolean op defaults to OR which is rarely helpful.
86 - $modifier = '+';
87 - }
88 -
 81+
8982 // Some languages such as Serbian store the input form in the search index,
9083 // so we may need to search for matches in multiple writing system variants.
9184 $convertedVariants = $wgContLang->autoConvertToAllVariants( $term );
@@ -127,8 +120,7 @@
128121 $regexp = $this->regexTerm( $term, $wildcard );
129122 $this->searchTerms[] = $regexp;
130123 }
131 - wfDebug( __METHOD__ . ": Would search with '$searchon'\n" );
132 - wfDebug( __METHOD__ . ': Match with /' . implode( '|', $this->searchTerms ) . "/\n" );
 124+
133125 } else {
134126 wfDebug( __METHOD__ . ": Can't understand search query '{$filteredText}'\n" );
135127 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r58322Merge SQLite search from branches/sqlite/ to trunkmaxsem16:19, 29 October 2009

Status & tagging log