function search_api_autocomplete_views_searches in Search API Autocomplete 7
Returns a list of search views for the given index.
Parameters
SearchApiIndex $index: The index whose searches should be returned.
Return value
array An array of searches, keyed by their machine name. The values are arrays with the following keys:
- name: A human-readable name for this search.
- options: (optional) An array of options to use for this search. Type-specific options should go into the "custom" nested key in these options.
1 string reference to 'search_api_autocomplete_views_searches'
File
- ./
search_api_autocomplete.search_api_views.inc, line 65 - Contains code for integrating with the "Search views" module.
Code
function search_api_autocomplete_views_searches(SearchApiIndex $index) {
$ret = array();
$base_table = 'search_api_index_' . $index->machine_name;
foreach (views_get_all_views() as $name => $view) {
if ($view->base_table === $base_table) {
// @todo Check whether there is an exposed fulltext filter
$ret['search_api_views_' . $name] = array(
'name' => !empty($view->human_name) ? $view->human_name : $name,
);
}
}
return $ret;
}