From: Gargaj Date: Sat, 6 Sep 2014 00:14:01 +0000 (+0200) Subject: Elasticsearch: fix select when fields are explicit X-Git-Tag: v4.2.0~50 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=02e574c8e98c7642b53138629b13ec08ced855da;p=adminer.git Elasticsearch: fix select when fields are explicit If fields are explicitly said, ES returns each row as an array. --- 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;