From ac9fd04f87d13fcd75d3a3e6b87d8b2fcc5db091 Mon Sep 17 00:00:00 2001 From: Peter Knut Date: Sun, 25 Aug 2024 22:14:35 +0200 Subject: [PATCH] Fix field selection in Elasticsearch Thanks to cweiske: https://github.com/adminerevo/adminerevo/pull/159 --- plugins/drivers/elastic.php | 2 +- plugins/drivers/elastic5.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/drivers/elastic.php b/plugins/drivers/elastic.php index 8d450ad0..cf4b17f2 100644 --- a/plugins/drivers/elastic.php +++ b/plugins/drivers/elastic.php @@ -133,7 +133,7 @@ if (isset($_GET["elastic"])) { function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) { $data = array(); if ($select != array("*")) { - $data["fields"] = $select; + $data["fields"] = array_values($select); } if ($order) { diff --git a/plugins/drivers/elastic5.php b/plugins/drivers/elastic5.php index 62283226..1ad0cb27 100644 --- a/plugins/drivers/elastic5.php +++ b/plugins/drivers/elastic5.php @@ -121,7 +121,7 @@ if (isset($_GET["elastic5"])) { function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) { $data = array(); if ($select != array("*")) { - $data["fields"] = $select; + $data["fields"] = array_values($select); } if ($order) {