]> git.joonet.de Git - adminer.git/commitdiff
Elasticsearch: fix select when fields are explicit
authorGargaj <gargaj@conspiracy.hu>
Sat, 6 Sep 2014 00:14:01 +0000 (02:14 +0200)
committerJakub Vrana <jakub@vrana.cz>
Thu, 11 Sep 2014 15:44:05 +0000 (08:44 -0700)
If fields are explicitly said, ES returns each row as an array.

adminer/drivers/elastic.inc.php

index 4d7614c69c76c0e26ee701edc984a09708aec340..b266a6bb65eb7e255712e1011df16de5796ec9c5 100644 (file)
@@ -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;