X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSearchUpdate.php;h=dc383fe18840b55df053e8283d51a035ff5fe4f3;hb=a0c7d7ce35a1e5c1ec748d8937e3fe0bebcf9f99;hp=859cccc4f1c65af21524528bfa34207146118041;hpb=412eda051740b525169ffca2666ab18600c56501;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SearchUpdate.php b/includes/SearchUpdate.php index 859cccc4f1..dc383fe188 100644 --- a/includes/SearchUpdate.php +++ b/includes/SearchUpdate.php @@ -1,7 +1,6 @@ tableName( 'searchindex' ); + $search =& SearchEngine::create(); + $lc = $search->legalSearchChars() . '&#;'; - if( $this->mText == false ) { - # Just update the title - $lowpri = $db->lowPriorityOption(); - $sql = "UPDATE $lowpri $searchindex SET si_title='" . - $db->strencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) . - "' WHERE si_page={$this->mId}"; - $db->query( $sql, "SearchUpdate::doUpdate" ); + if( $this->mText === false ) { + $search->updateTitle($this->mId, + Title::indexTitle( $this->mNamespace, $this->mTitle )); wfProfileOut( $fname ); return; } @@ -105,17 +99,16 @@ class SearchUpdate { # Strip wiki '' and ''' $text = preg_replace( "/''[']*/", " ", $text ); wfProfileOut( "$fname-regexps" ); - $db->replace( 'searchindex', array(array('si_page')), - array( - 'si_page' => $this->mId, - 'si_title' => $db->strencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ), - 'si_text' => $db->strencode( $text ) - ), 'SearchUpdate::doUpdate' ); + $search->update($this->mId, Title::indexTitle( $this->mNamespace, $this->mTitle ), + $text); wfProfileOut( $fname ); } } -/* Placeholder class */ +/** + * Placeholder class + * @package MediaWiki + */ class SearchUpdateMyISAM extends SearchUpdate { # Inherits everything }