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 <smalys...@wikimedia.org>

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

Reply via email to