[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Allow forceSearchIndex to ask for specific index to be used

2016-10-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Allow forceSearchIndex to ask for specific index to be used
..


Allow forceSearchIndex to ask for specific index to be used

Bug: T147957
Change-Id: I2144b684f6c43b9e48e026126f4b07b0ac4f9e66
---
M maintenance/forceSearchIndex.php
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/forceSearchIndex.php b/maintenance/forceSearchIndex.php
index 17e88eb..2d5099e 100644
--- a/maintenance/forceSearchIndex.php
+++ b/maintenance/forceSearchIndex.php
@@ -103,6 +103,7 @@
'this with --indexOnSkip for the first half of the two 
phase index build.' );
$this->addOption( 'namespace', 'Only index pages in this given 
namespace', false, true );
$this->addOption( 'excludeContentTypes', 'Exclude pages of the 
specified content types. These must be a comma separated list of strings such 
as "wikitext" or "json" matching the CONTENT_MODEL_* constants.', false, true, 
false );
+   $this->addOption( 'useDbIndex', 'Use specific index when 
fetching IDs from the database.', false, true, false );
}
 
public function execute() {
@@ -445,6 +446,10 @@
"{$columnPrefix}_content_model NOT IN ($list)",
] );
}
+   if ( $this->hasOption( 'useDbIndex' ) ) {
+   $index = $this->getOption( 'useDbIndex' );
+   $it->addOptions( [ 'USE INDEX' => $index ] );
+   }
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2144b684f6c43b9e48e026126f4b07b0ac4f9e66
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Cindy-the-browser-test-bot 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Manybubbles 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: Tjones 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Allow forceSearchIndex to ask for specific index to be used

2016-10-18 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

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

Change subject: Allow forceSearchIndex to ask for specific index to be used
..

Allow forceSearchIndex to ask for specific index to be used

Bug: T147957
Change-Id: I2144b684f6c43b9e48e026126f4b07b0ac4f9e66
---
M maintenance/forceSearchIndex.php
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/maintenance/forceSearchIndex.php b/maintenance/forceSearchIndex.php
index 17e88eb..94544dd 100644
--- a/maintenance/forceSearchIndex.php
+++ b/maintenance/forceSearchIndex.php
@@ -103,6 +103,7 @@
'this with --indexOnSkip for the first half of the two 
phase index build.' );
$this->addOption( 'namespace', 'Only index pages in this given 
namespace', false, true );
$this->addOption( 'excludeContentTypes', 'Exclude pages of the 
specified content types. These must be a comma separated list of strings such 
as "wikitext" or "json" matching the CONTENT_MODEL_* constants.', false, true, 
false );
+   $this->addOption( 'useIndex', 'Use specific index when fetching 
IDs from the database.', false, true, false );
}
 
public function execute() {
@@ -445,6 +446,10 @@
"{$columnPrefix}_content_model NOT IN ($list)",
] );
}
+   if ( $this->hasOption( 'useIndex' ) ) {
+   $index = $this->getOption( 'useIndex' );
+   $it->addOptions( [ 'USE INDEX' => $index ] );
+   }
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2144b684f6c43b9e48e026126f4b07b0ac4f9e66
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 

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