diff --git a/src/Elasticsearch/Util/FieldDatatypeTrait.php b/src/Elasticsearch/Util/FieldDatatypeTrait.php index 6defd345353..504614ba2b5 100644 --- a/src/Elasticsearch/Util/FieldDatatypeTrait.php +++ b/src/Elasticsearch/Util/FieldDatatypeTrait.php @@ -74,7 +74,7 @@ private function getNestedFieldPath(string $resourceClass, string $property): ?s ) { $nestedPath = $this->getNestedFieldPath($nextResourceClass, implode('.', $properties)); - return null === $nestedPath ? $nestedPath : "$currentProperty.$nestedPath"; + return null === $nestedPath ? $currentProperty : "$currentProperty.$nestedPath"; } if (