protected function getClassesForIndex(SolrIndex $index, $filterClasses = null)
    {
        // Get base classes
        $classes = $index->getClasses();
        if (!$filterClasses) {
            return $classes;
        }

        // Apply filter
        if (!is_array($filterClasses)) {
            $filterClasses = explode(',', $filterClasses);
        }
        return array_intersect_key($classes, array_combine($filterClasses, $filterClasses));
    }