From 815a674aefec4c2961985c557985e2caebce5042 Mon Sep 17 00:00:00 2001 From: Nikita Chernykh Date: Wed, 11 Oct 2023 12:47:52 +0500 Subject: [PATCH] Update keyword facet --- src/ElasticSearch/Facet/Type/KeywordFacet.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ElasticSearch/Facet/Type/KeywordFacet.php b/src/ElasticSearch/Facet/Type/KeywordFacet.php index ffc1aac..b525e51 100644 --- a/src/ElasticSearch/Facet/Type/KeywordFacet.php +++ b/src/ElasticSearch/Facet/Type/KeywordFacet.php @@ -11,9 +11,13 @@ final class KeywordFacet extends Facet */ public function es(): array { + $value = is_array($this->value) ? + array_map(static fn($value) => (string) $value, $this->value) : + (string) $this->value; + return [ 'facet_code' => $this->property->getKey(), - 'facet_value' => (string) $this->value, + 'facet_value' => $value ]; } } -- GitLab