You are here

public function SearchApiAlterFileEntityPublic::supportsIndex in Search API 7

Implements SearchApiAlterCallbackInterface::supportsIndex().

The default implementation always returns TRUE.

Overrides SearchApiAbstractAlterCallback::supportsIndex

File

includes/callback_file_entity_public.inc, line 16
Contains SearchApiAlterFileEntityPublic.

Class

SearchApiAlterFileEntityPublic
Excludes file entities in the private folder from being indexed.

Code

public function supportsIndex(SearchApiIndex $index) {
  if ($this
    ->isMultiEntityIndex($index)) {
    return in_array('file', $index->options['datasource']['types']);
  }
  return $index
    ->getEntityType() === 'file';
}