protected function parseLanguage(\stdClass $schema)
    {
        $language = 'english';
        if (!is_object($schema) || !isset($schema->fieldTypes)) {
            return $language;
        }

        foreach ($schema->fieldTypes as $fieldType) {
            if ($fieldType->name !== 'text') {
                continue;
            }
            // we have a text field
            foreach ($fieldType->queryAnalyzer->filters as $filter) {
                if ($filter->class === 'solr.ManagedSynonymGraphFilterFactory') {
                    $language = $filter->managed;
                }
            }
        }

        return $language;
    }