Manybubbles has uploaded a new change for review.

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

Change subject: Output more data from Elasticsearch for pages
......................................................................

Output more data from Elasticsearch for pages

Makes ?action=cirrusdump output look more like Elasticsearch's get result.

Change-Id: I281dbbffc909c3e0d14f018950f5bbd42f705569
---
M includes/Dump.php
M tests/browser/features/dump_action.feature
2 files changed, 9 insertions(+), 1 deletion(-)


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

diff --git a/includes/Dump.php b/includes/Dump.php
index fed41e0..58d5b65 100644
--- a/includes/Dump.php
+++ b/includes/Dump.php
@@ -43,7 +43,13 @@
 
                $result = array();
                foreach ( $esSources as $esSource ) {
-                       $result[ $esSource->getIndex() ] = $esSource->getData();
+                       $result[] = array(
+                               '_index' => $esSource->getIndex(),
+                               '_type' => $esSource->getType(),
+                               '_id' => $esSource->getId(),
+                               '_version' => $esSource->getVersion(),
+                               '_source' => $esSource->getData(),
+                       );
                }
                echo json_encode( $result );
 
diff --git a/tests/browser/features/dump_action.feature 
b/tests/browser/features/dump_action.feature
index 27373cc..f933360 100644
--- a/tests/browser/features/dump_action.feature
+++ b/tests/browser/features/dump_action.feature
@@ -5,3 +5,5 @@
     Then the page text contains Main Page
     And the page text contains template
     And the page text contains namespace
+    And the page text contains version
+    And the page text contains _id

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I281dbbffc909c3e0d14f018950f5bbd42f705569
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to