You are here

public function SearchApiSolrService::supportsFeature in Search API Solr 7

Implements SearchApiServiceInterface::__construct().

The default implementation always returns FALSE.

Overrides SearchApiAbstractService::supportsFeature

1 call to SearchApiSolrService::supportsFeature()
SearchApiSolrService::getFieldNames in includes/service.inc
Create a list of all indexed field names mapped to their Solr field names.

File

includes/service.inc, line 368

Class

SearchApiSolrService
Search service class using Solr server.

Code

public function supportsFeature($feature) {

  // First, check the features we always support.
  $supported = drupal_map_assoc(array(
    'search_api_autocomplete',
    'search_api_between',
    'search_api_facets',
    'search_api_facets_operator_or',
    'search_api_grouping',
    'search_api_mlt',
    'search_api_multi',
    'search_api_service_extra',
    'search_api_spellcheck',
    'search_api_data_type_location',
    'search_api_data_type_geohash',
    'search_api_random_sort',
  ));
  if (isset($supported[$feature])) {
    return TRUE;
  }

  // If it is a custom data type, maybe we support it automatically via
  // search_api_solr_hook_search_api_data_type_info().
  if (substr($feature, 0, 21) != 'search_api_data_type_') {
    return FALSE;
  }
  $type = substr($feature, 21);
  $type = search_api_get_data_type_info($type);

  // We only support it if the "prefix" key is set.
  return $type && !empty($type['prefix']);
}