Retrieve and return the mapping for the given metadata block.

        Arguments:
            block (str): The top-level field to fetch the mapping for (for example, ``"mdf"``),
                    or the special values ``None`` for everything or ``"top"`` for just the
                    top-level fields.
                    **Default:** ``None``.
            index (str): The Search index to map. **Default:** The current index.

        Returns:
            dict: ``field:datatype`` pairs.

def show_fields(self, block=None):
        """Retrieve and return the mapping for the given metadata block.

        Arguments:
            block (str): The top-level field to fetch the mapping for (for example, ``"mdf"``),
                    or the special values ``None`` for everything or ``"top"`` for just the
                    top-level fields.
                    **Default:** ``None``.
            index (str): The Search index to map. **Default:** The current index.

        Returns:
            dict: ``field:datatype`` pairs.
        """
        mapping = self._mapping()
        if block is None:
            return mapping
        elif block == "top":
            blocks = set()
            for key in mapping.keys():
                blocks.add(key.split(".")[0])
            block_map = {}
            for b in blocks:
                block_map[b] = "object"
        else:
            block_map = {}
            for key, value in mapping.items():
                if key.startswith(block):
                    block_map[key] = value
        return block_map