jenkins-bot has submitted this change and it was merged. Change subject: Auto-populate the wiki field when reindexing ......................................................................
Auto-populate the wiki field when reindexing This field was recently added, but for an existing index will take quite some time to naturally be populated in 100% of pages by the normal update process. Instead of waiting and hoping populate it on demand during an in-place reindex. Change-Id: I5cdb77b171222601d5e45438ef9d12f52ac42364 --- M includes/Maintenance/Reindexer.php 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Smalyshev: Looks good to me, but someone else must approve DCausse: Looks good to me, approved jenkins-bot: Verified Objections: Cindy-the-browser-test-bot: There's a problem with this change, please improve diff --git a/includes/Maintenance/Reindexer.php b/includes/Maintenance/Reindexer.php index c22221c..ca08722 100644 --- a/includes/Maintenance/Reindexer.php +++ b/includes/Maintenance/Reindexer.php @@ -360,6 +360,12 @@ // out any old fields that we no longer use. $data = Util::cleanUnusedFields( $result->getSource(), $properties ); + // This field was added July, 2016. For the first reindex that occurs after it was added it will + // not exist in the documents, so add it here. + if ( !isset( $data['wiki'] ) ) { + $data['wiki'] = wfWikiId(); + } + // Note that while setting the opType to create might improve performance slightly it can cause // trouble if the scroll returns the same id twice. It can do that if the document is updated // during the scroll process. I'm unclear on if it will always do that, so you still have to -- To view, visit https://gerrit.wikimedia.org/r/305583 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5cdb77b171222601d5e45438ef9d12f52ac42364 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org> Gerrit-Reviewer: Cindy-the-browser-test-bot <bernhardsone...@gmail.com> Gerrit-Reviewer: DCausse <dcau...@wikimedia.org> Gerrit-Reviewer: EBernhardson <ebernhard...@wikimedia.org> Gerrit-Reviewer: Gehel <gleder...@wikimedia.org> Gerrit-Reviewer: Manybubbles <never...@wikimedia.org> Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits