You are here

facets_map_widget.module in Search API Location 8

Contains hook implementations.

File

modules/facets_map_widget/facets_map_widget.module
View source
<?php

/**
 * @file
 * Contains hook implementations.
 */

/**
 * Implements hook_facets_search_api_query_type_mapping_alter().
 */
function facets_map_widget_facets_search_api_query_type_mapping_alter($backend_plugin_id, array &$query_types) {
  $backend_manager = \Drupal::service('plugin.manager.search_api.backend');

  /** @var \Drupal\search_api\Backend\BackendInterface $plugin */
  $plugin = $backend_manager
    ->createInstance($backend_plugin_id);

  // Check if rpt data type is supported by the backend plugin before adding the
  // query type to the allowed query types.
  if ($plugin
    ->supportsDataType('rpt')) {
    $query_types['rpt'] = 'search_api_rpt';
  }
}