jenkins-bot has submitted this change and it was merged.
Change subject: Add index to results in generator mode
......................................................................
Add index to results in generator mode
Bug: T137171
Change-Id: I1fecc0b5f3b04c611839d8491e7919f690763f02
---
M includes/api/ApiQueryGeoSearchElastic.php
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
EBernhardson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/api/ApiQueryGeoSearchElastic.php
b/includes/api/ApiQueryGeoSearchElastic.php
index d6df0b4..608b3d0 100644
--- a/includes/api/ApiQueryGeoSearchElastic.php
+++ b/includes/api/ApiQueryGeoSearchElastic.php
@@ -183,6 +183,11 @@
}
} else {
$resultPageSet->populateFromQueryResult(
$this->getDB(), $res );
+ $res->rewind();
+ foreach ( $res as $row ) {
+ $title = Title::newFromRow( $row );
+ $resultPageSet->setGeneratorData( $title, [
'index' => $res->key() - 1 ] );
+ }
}
}
--
To view, visit https://gerrit.wikimedia.org/r/293244
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1fecc0b5f3b04c611839d8491e7919f690763f02
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits