From 02e574c8e98c7642b53138629b13ec08ced855da Mon Sep 17 00:00:00 2001 From: Gargaj Date: Sat, 6 Sep 2014 02:14:01 +0200 Subject: [PATCH] Elasticsearch: fix select when fields are explicit If fields are explicitly said, ES returns each row as an array. --- adminer/drivers/elastic.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adminer/drivers/elastic.inc.php b/adminer/drivers/elastic.inc.php index 4d7614c6..b266a6bb 100644 --- a/adminer/drivers/elastic.inc.php +++ b/adminer/drivers/elastic.inc.php @@ -158,6 +158,9 @@ if (isset($_GET["elastic"])) { } } foreach ($fields as $key => $val) { + if ($data["fields"]) { + $val = $val[0]; + } $row[$key] = (is_array($val) ? json_encode($val) : $val); //! display JSON and others differently } $return[] = $row;