protected function buildArrayFromMappingCollection(MappingCollection $mappingCollection)
    {
        $return = [];

        /** @var $mappingInformation Mapping */
        foreach ($mappingCollection as $mappingInformation) {
            $indexName = $mappingInformation->getType()->getIndex()->getName();
            $typeName = $mappingInformation->getType()->getName();
            if (isset($return[$indexName][$typeName])) {
                throw new ElasticSearchException('There was more than one mapping present in index %s with type %s, which must not happen.', 1339758480);
            }

            $return[$indexName][$typeName]['mappingInstance'] = $mappingInformation;
            $return[$indexName][$typeName]['properties'] = $mappingInformation->getProperties();
        }

        return $return;
    }