def _collect_fields(self) -> Iterator[Field]:
        """Iterate over all Field objects within, including multi fields."""
        fields = cast(Dict[str, Field], self.properties.to_dict())  # type: ignore[attr-defined]
        for f in fields.values():
            yield f
            # multi fields
            if hasattr(f, "fields"):
                yield from f.fields.to_dict().values()
            # nested and inner objects
            if hasattr(f, "_collect_fields"):
                yield from f._collect_fields()
Iterate over all Field objects within, including multi fields.
elasticsearch/dsl/mapping_base.py