function search_api_autocomplete_pages_searches in Search API Autocomplete 7
Returns a list of search pages 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_pages_searches'
File
- ./
search_api_autocomplete.search_api_page.inc, line 39 - Contains code for integrating with the "Search pages" module.
Code
function search_api_autocomplete_pages_searches(SearchApiIndex $index) {
$ret = array();
foreach (search_api_page_load_multiple(FALSE, array(
'index_id' => $index->machine_name,
)) as $page) {
$id = 'search_api_page_' . $page->machine_name;
$ret[$id]['name'] = $page->name;
$ret[$id]['options']['custom']['page_id'] = $page->machine_name;
}
return $ret;
}