Skip to content

Commit

Permalink
Nested object mapping fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Spamercz committed Jul 13, 2021
1 parent c22b529 commit 464d329
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Mapping/Settings/Mapping/FieldObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public function toArray(): array
$fields[$field->key()] = $field->toArray();
continue;
}
if ($field instanceof \Spameri\ElasticQuery\Mapping\Settings\Mapping\NestedObject) {
$fields[$field->key()] = $field->toArray();
continue;
}

$fields[$field->key()] = $field->toArray()[$field->key()];
}
Expand Down
4 changes: 4 additions & 0 deletions src/Mapping/Settings/Mapping/NestedObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public function toArray(): array
$fields[$field->key()] = $field->toArray();
continue;
}
if ($field instanceof \Spameri\ElasticQuery\Mapping\Settings\Mapping\NestedObject) {
$fields[$field->key()] = $field->toArray();
continue;
}

$fields[$field->key()] = $field->toArray()[$field->key()];
}
Expand Down

0 comments on commit 464d329

Please sign in to comment.