You are here

public function SearchApiFacetapiAdapter::getSearchKeys in Search API 7

Returns the search keys.

File

contrib/search_api_facetapi/plugins/facetapi/adapter.inc, line 189
Classes used by the Facet API module.

Class

SearchApiFacetapiAdapter
Facet API adapter for the Search API module.

Code

public function getSearchKeys() {
  $search = $this
    ->getCurrentSearch();

  // If the search is empty then there's no reason to continue.
  if (!$search) {
    return NULL;
  }
  $keys = $search[0]
    ->getOriginalKeys();
  if (is_array($keys)) {

    // This will happen nearly never when displaying the search keys to the
    // user, so go with a simple work-around.
    // If someone complains, we can easily add a method for printing them
    // properly.
    $keys = '[' . t('complex query') . ']';
  }
  drupal_alter('search_api_facetapi_keys', $keys, $search[0]);
  return $keys;
}