瀏覽代碼

add timed_out shards aggregations

visuddhinanda 1 天之前
父節點
當前提交
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 function __construct(
         public int $took,
         public int $took,
+        public bool $timed_out,
+        public ShardsDTO $shards,
         public HitsDTO $hits,
         public HitsDTO $hits,
+        public AggregationsDTO $aggregations,
+
     ) {}
     ) {}
 
 
     public static function fromArray(array $data): self
     public static function fromArray(array $data): self
     {
     {
         return new self(
         return new self(
             took: $data['took'],
             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']),
         );
         );
     }
     }
 }
 }