function apachesolr_search_load_all_search_types in Apache Solr Search 6.3
Same name and namespace in other branches
- 8 apachesolr_search.module \apachesolr_search_load_all_search_types()
- 7 apachesolr_search.module \apachesolr_search_load_all_search_types()
Function that loads all the search types
Return value
array $search_types
3 calls to apachesolr_search_load_all_search_types()
- apachesolr_search_ajax_search_page_default in ./
apachesolr_search.admin.inc - Callback element needs only select the portion of the form to be updated. Since #ajax['callback'] return can be HTML or a renderable array (or an array of commands), we can just return a piece of the form.
- apachesolr_search_menu_alter in ./
apachesolr_search.module - apachesolr_search_page_settings_form in ./
apachesolr_search.admin.inc - Menu callback/form-builder for the form to create or edit a search page.
File
- ./
apachesolr_search.module, line 243 - Provides a content search implementation for node content for use with the Apache Solr search application.
Code
function apachesolr_search_load_all_search_types() {
static $search_types;
if (isset($search_types)) {
return $search_types;
}
// Use cache_get to avoid DB when using memcache, etc.
$cache = cache_get('apachesolr_search:search_types', 'cache_apachesolr');
if (isset($cache->data)) {
$search_types = $cache->data;
}
else {
$search_types = array(
'tid' => array(
'name' => apachesolr_field_name_map('tid'),
'default menu' => 'taxonomy/term/%',
'title callback' => 'apachesolr_search_get_taxonomy_term_title',
),
'is_uid' => array(
'name' => apachesolr_field_name_map('is_uid'),
'default menu' => 'user/%/search',
'title callback' => 'apachesolr_search_get_user_title',
),
'bundle' => array(
'name' => apachesolr_field_name_map('bundle'),
'default menu' => 'search/type/%',
'title callback' => 'apachesolr_search_get_value_title',
),
'ss_language' => array(
'name' => apachesolr_field_name_map('ss_language'),
'default menu' => 'search/language/%',
'title callback' => 'apachesolr_search_get_value_title',
),
);
drupal_alter('apachesolr_search_types', $search_types);
cache_set('apachesolr_search:search_types', $search_types, 'cache_apachesolr');
}
return $search_types;
}