DCausse has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/278222

Change subject: Fix broken updateSuggesterIndex
......................................................................

Fix broken updateSuggesterIndex

Change-Id: If8d7640de1cfb2f45da1322532d8cf42fadb7e53
---
M maintenance/updateSuggesterIndex.php
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/22/278222/1

diff --git a/maintenance/updateSuggesterIndex.php 
b/maintenance/updateSuggesterIndex.php
index 59936ca..bf4c4c7 100644
--- a/maintenance/updateSuggesterIndex.php
+++ b/maintenance/updateSuggesterIndex.php
@@ -485,9 +485,13 @@
 
        private function indexData( $sourceIndexType = 
Connection::CONTENT_INDEX_TYPE ) {
                global $wgCirrusSearchCompletionDefaultScore;
-               $scoreMethodName = $this->getOption( 'scoringMethod', 
$wgCirrusSearchCompletionDefaultScore );
-               $this->scoreMethod = 
SuggestScoringMethodFactory::getScoringMethod( $scoreMethodName );
-               $this->builder = new SuggestBuilder( $this->scoreMethod, 
$this->withGeo );
+               if ( $this->scoringMethod == null ) {
+                       $scoreMethodName = $this->getOption( 'scoringMethod', 
$wgCirrusSearchCompletionDefaultScore );
+                       $this->scoreMethod = 
SuggestScoringMethodFactory::getScoringMethod( $scoreMethodName );
+               }
+               if ( $this->builder == null ) {
+                       $this->builder = new SuggestBuilder( 
$this->scoreMethod, $this->withGeo );
+               }
 
                $query = new Query();
                $query->setFields( array( '_id', '_type', '_source' ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/278222
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8d7640de1cfb2f45da1322532d8cf42fadb7e53
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <dcau...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to