protected function applyAnalyzer(array $mapping, Field $field, \stdClass $rootObject, $path = null)
    {
        if (null === $this->defaultAnalyzer) {
            return $mapping;
        }

        if (!isset($mapping['type']) || 'text' !== $mapping['type']) {
            return $mapping;
        }

        if (isset($mapping['index']) && false === $mapping['index']) {
            return $mapping;
        }

        if (isset($mapping['analyzer'])) {
            return $mapping;
        }

        $mapping['analyzer'] = $this->defaultAnalyzer;
        return $mapping;
    }