private function getMappingFields($indexName, $typeConfigData)
    {
        \Magento\Framework\Profiler::start('ES:Get dynamic fields config');
        $fields = $this->getDynamicFields($indexName, $typeConfigData);
        \Magento\Framework\Profiler::stop('ES:Get dynamic fields config');

        foreach ($typeConfigData['mapping']['staticFields'] as $fieldName => $fieldConfig) {
            $field = $this->mappingFieldFactory->create(['name' => $fieldName] + $fieldConfig);

            if (isset($fields[$fieldName])) {
                // Field also exists with dynamic providers.
                // We merge the dynamic config and the config coming from configuration file.
                // XML file has precedence.
                $field = $fields[$fieldName]->mergeConfig($fieldConfig['fieldConfig'] ?? []);
            }

            $fields[$fieldName] = $field;
        }

        return $fields;
    }