Просмотр исходного кода

add timed_out shards aggregations

visuddhinanda 1 день назад
Родитель
Сommit
44ba977afd
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      api-v12/app/DTO/Search/SearchDataDTO.php

+ 8 - 1
api-v12/app/DTO/Search/SearchDataDTO.php

@@ -6,14 +6,21 @@ class SearchDataDTO
 {
     public function __construct(
         public int $took,
+        public bool $timed_out,
+        public ShardsDTO $shards,
         public HitsDTO $hits,
+        public AggregationsDTO $aggregations,
+
     ) {}
 
     public static function fromArray(array $data): self
     {
         return new self(
             took: $data['took'],
-            hits: HitsDTO::fromArray($data['hits'])
+            timed_out: $data['timed_out'],
+            shards: ShardsDTO::fromArray($data['_shards']),
+            hits: HitsDTO::fromArray($data['hits']),
+            aggregations: AggregationsDTO::fromArray($data['aggregations']),
         );
     }
 }