You are here

function hook_search_api_facetapi_keys_alter in Search API 7

Lets modules alter the search keys that are returned to FacetAPI and used in the current search block and breadcrumb trail.

Parameters

string $keys: The string representing the user's current search query.

SearchApiQuery $query: The SearchApiQuery object for the current search.

1 invocation of hook_search_api_facetapi_keys_alter()
SearchApiFacetapiAdapter::getSearchKeys in contrib/search_api_facetapi/plugins/facetapi/adapter.inc
Returns the search keys.

File

contrib/search_api_facetapi/search_api_facetapi.api.php, line 22
Hooks provided by the Search facets module.

Code

function hook_search_api_facetapi_keys_alter(&$keys, $query) {
  if ($keys == '[' . t('all items') . ']') {

    // Change $keys to something else, perhaps based on filters in the query
    // object.
  }
}