r61857 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61856‎ | r61857 | r61858 >
Date:15:09, 2 February 2010
Author:philip
Status:reverted (Comments)
Tags:
Comment:
Follow up r61856. Apply related changes in extensions.
Modified paths:
  • /trunk/extensions/AdvancedSearch/AdvancedSearchCategoryIntersector.php (modified) (history)
  • /trunk/extensions/AdvancedSearch/AdvancedSearchPager.php (modified) (history)
  • /trunk/extensions/MWSearch/MWSearchUpdater.php (modified) (history)
  • /trunk/extensions/MWSearch/MWSearch_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MWSearch/MWSearch_body.php
@@ -10,7 +10,7 @@
1111 */
1212 function searchText( $term ) {
1313 global $wgContLang;
14 - $term = $wgContLang->stripForSearch( $term, false );
 14+ $term = $wgContLang->normalizeForSearch( $term );
1515 return LuceneSearchSet::newFromQuery( isset($this->related)? 'related' : 'search',
1616 $term, $this->namespaces, $this->limit, $this->offset, $this->searchingEverything() );
1717 }
Index: trunk/extensions/MWSearch/MWSearchUpdater.php
@@ -21,7 +21,7 @@
2222 */
2323 function updatePage( $dbname, $title, $text ) {
2424 global $wgContLang;
25 - $text = $wgContLang->stripForSearch( $text, false );
 25+ $text = $wgContLang->normalizeForSearch( $text );
2626 return MWSearchUpdater::sendRPC( 'searchupdater.updatePage',
2727 array( $dbname, $title, $text ) );
2828 }
Index: trunk/extensions/AdvancedSearch/AdvancedSearchPager.php
@@ -402,7 +402,7 @@
403403 else
404404 {
405405 global $wgContLang;
406 - $s = $wgContLang->stripForSearch($b);
 406+ $s = $wgContLang->normalizeForSearch($b);
407407 $s = $searchEngine->normalizeText($s);
408408 $s = $this->mDb->strencode($s);
409409 # If $s contains spaces or ( ) :, quote it
Index: trunk/extensions/AdvancedSearch/AdvancedSearchCategoryIntersector.php
@@ -38,7 +38,7 @@
3939 static function update($pageid, $categories)
4040 {
4141 global $wgContLang;
42 - $ctext = $wgContLang->stripForSearch(implode(' ', $categories));
 42+ $ctext = $wgContLang->normalizeForSearch(implode(' ', $categories));
4343 $ctext = self::getSearchEngine()->normalizeText($ctext);
4444 $dbw = wfGetDb(DB_MASTER);
4545 $dbw->replace('categorysearch', 'cs_page',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61856Follow up r60742, r60743, r60764, r60766, r61214, r61390. Split stripForSearc...philip15:09, 2 February 2010

Comments

#Comment by Tim Starling (talk | contribs)   08:13, 17 February 2010

When we deploy this and the other revisions that make up this project (r60742 etc.), will it instantly break the search engine on all Chinese wikis, requiring an index rebuild?

Actually I think even an index rebuild won't work on Wikimedia, since if I remember it correctly, we don't use MWSearchUpdater.php there, instead we use an XML dump of the current text which is fed straight into Java. So MW doesn't get the opportunity to convert double-width characters or anything. There will be a mismatch between LuceneSearch::searchText() and the contents of the index, so it'll be impossible to search for double-width characters.

We may need a configuration global variable to switch off this feature, for now.

#Comment by RobLa-WMF (talk | contribs)   06:24, 2 February 2011

Appears to be reverted by r63622 and r63623

Status & tagging log