正在显示
1 个修改的文件
包含
10 行增加
和
8 行删除
| @@ -55,14 +55,16 @@ class BulkData { | @@ -55,14 +55,16 @@ class BulkData { | ||
| 55 | */ | 55 | */ |
| 56 | public function toParams():array { | 56 | public function toParams():array { |
| 57 | $params = []; | 57 | $params = []; |
| 58 | - foreach ($this->data as $index=>$item){ | ||
| 59 | - $params[] = [ | ||
| 60 | - 'index' => [ | ||
| 61 | - '_index' => $index, | ||
| 62 | - '_id' => $item['_id'] | ||
| 63 | - ] | ||
| 64 | - ]; | ||
| 65 | - $params[] = $item['_source']; | 58 | + foreach ($this->data as $index=>$items){ |
| 59 | + foreach ($items as $item){ | ||
| 60 | + $params[] = [ | ||
| 61 | + 'index' => [ | ||
| 62 | + '_index' => $index, | ||
| 63 | + '_id' => $item['_id'] | ||
| 64 | + ] | ||
| 65 | + ]; | ||
| 66 | + $params[] = $item['_source']; | ||
| 67 | + } | ||
| 66 | } | 68 | } |
| 67 | return $params; | 69 | return $params; |
| 68 | } | 70 | } |
-
请 注册 或 登录 后发表评论