function apachesolr_multisitesearch_settings in Apache Solr Multisite Search 7
Same name and namespace in other branches
- 6.3 apachesolr_multisitesearch.admin.inc \apachesolr_multisitesearch_settings()
Creates the form that allows the user to select which facets will be enabled.
Only enabled facets are sent to solr. Fewer enabled facets can reduce the load on the search server. Blocks are only offered for enabled facets, so this also reduces the clutter on the blocks admin page.
1 string reference to 'apachesolr_multisitesearch_settings'
- apachesolr_multisitesearch_menu in ./
apachesolr_multisitesearch.module - Implements hook_menu().
File
- ./
apachesolr_multisitesearch.admin.inc, line 15 - Administrative pages for the Apache Solr Multi-Site Search framework.
Code
function apachesolr_multisitesearch_settings() {
$form = array();
$form['#tree'] = TRUE;
$form['submit_message'] = array(
'#type' => 'value',
'#value' => t('The Apache Solr Multisite Search filter settings were changed. To arrange the blocks for your enabled filters, visit the <a href="@url">blocks administration page</a>.', array(
'@url' => url('admin/structure/block'),
)),
);
$form['admin'] = array(
'#type' => 'fieldset',
'#title' => t('Administrative functions'),
);
$form['admin']['refresh'] = array(
'#type' => 'submit',
'#value' => t('Refresh metadata now'),
'#prefix' => '<p>' . t('Multisite metadata is used to communicate between all of the sites in a multisite setup. If site names are not showing properly in the search results and facet blocks try refreshing the metadata. Metadata is also refreshed periodically on cron runs.') . '</p>',
'#submit' => array(
'apachesolr_multisitesearch_refresh_metadata_now',
),
);
$options = apachesolr_multisitesearch_get_site_options();
if (count($options) > 0) {
$form['admin']['delete']['hashes'] = array(
'#type' => 'checkboxes',
'#title' => t('Delete data from sites using this index'),
'#options' => $options,
'#description' => t('If you end up in a situation where the index has hashes that no longer map to real active sites, use this option to delete the outdated data. If you delete another site\'s index from this site, that site will have to first trigger a re-index, and then run cron until the index is rebuilt.'),
);
$form['admin']['delete']['submit'] = array(
'#type' => 'submit',
'#value' => t('Delete selected indexes'),
'#submit' => array(
'apachesolr_multisitesearch_delete_indexes',
),
);
}
if (count(apachesolr_multisitesearch_query_bundles()) > 0) {
// Grab the bundle names from the metadata and load them as options.
$query_exclusion_options = apachesolr_multisitesearch_query_bundles();
// Grab the excluded item keys from the variables.
$excluded_bundles = variable_get('apachesolr_multisitesearch_query_exclusions', array());
$form['query_exclusions'] = array(
'#type' => 'fieldset',
'#title' => t('Search Result Exclusions'),
);
$form['query_exclusions']['exclusion_options'] = array(
'#type' => 'select',
'#prefix' => t('<p>Select content should which should be excluded from the search query. Hold the CTRL key to select more than one item.</p><div style="apache-multisitesearch-search-exclusion">'),
'#title' => t('Content Types'),
'#description' => t('Content types to exclude from search. Multiple selections are allowed.'),
'#multiple' => TRUE,
'#default_value' => $excluded_bundles ? $excluded_bundles : '',
'#options' => $query_exclusion_options,
'#suffix' => '</div>',
);
$form['query_exclusions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Exclude content'),
'#submit' => array(
'apachesolr_multisitesearch_exclude_indexes',
),
);
$form['query_exclusions']['clear'] = array(
'#type' => 'submit',
'#value' => t('Clear all exclusions'),
'#submit' => array(
'apachesolr_multisitesearch_exclude_indexes',
),
);
}
return $form;
}