From 6ce9e4f2155017029708575e866d24425ce7ba25 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Thu, 28 Nov 2024 10:46:10 +0100 Subject: [PATCH] Enhance search all properties --- Classes/Common/QueryParamsBuilder.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Classes/Common/QueryParamsBuilder.php b/Classes/Common/QueryParamsBuilder.php index 22b7858..a17c42d 100644 --- a/Classes/Common/QueryParamsBuilder.php +++ b/Classes/Common/QueryParamsBuilder.php @@ -51,10 +51,14 @@ public function setSearchParams($searchParams): QueryParamsBuilder $this->indexName = $this->params['index']; } else { $this->searchAll = true; - $this->indexName = Collection::wrap($this->settings)-> + $indexNames = Collection::wrap($this->settings)-> recursive()-> get('entityTypes')-> - pluck('indexName')-> + pluck('indexName'); + if ($indexNames->count() == 1) { + $this->searchAll = false; + } + $this->indexName = $indexNames-> join(','); } @@ -79,9 +83,9 @@ public function getQueryParams(): array ] ]; - //if ($this->searchAll == false) { + if ($this->searchAll == false) { $this->query['body']['aggs'] = self::getAggs($this->settings, $this->indexName); - //} + } $this->setCommonParams();