Commit 5bfeac4f authored by webchick's avatar webchick

Revert "Issue #1559244 by Xano, jhodgdon: Clean up search settings page."

This change was a bit more than we bargained for and caused critical tasks
to have to re-roll. Rolling back for now so we can discuss it more.

This reverts commit 541f24c2.
parent c2f76e09
......@@ -126,71 +126,73 @@ public function buildForm(array $form, array &$form_state) {
$count = format_plural($remaining, 'There is 1 item left to index.', 'There are @count items left to index.');
$percentage = ((int) min(100, 100 * ($total - $remaining) / max(1, $total))) . '%';
$status = '<p><strong>' . $this->t('%percentage of the site has been indexed.', array('%percentage' => $percentage)) . ' ' . $count . '</strong></p>';
$form['indexing'] = array(
$form['status'] = array(
'#type' => 'details',
'#title' => $this->t('Indexing'),
'#description' => $this->t("If you change settings related to how content is indexed, a re-index will be triggered. Searching will continue to work, but new content will not be indexed until all existing content has been re-indexed."),
'#title' => $this->t('Indexing status'),
);
$form['status']['status'] = array('#markup' => $status);
$form['status']['wipe'] = array(
'#type' => 'submit',
'#value' => $this->t('Re-index site'),
'#submit' => array(array($this, 'searchAdminReindexSubmit')),
);
$items = drupal_map_assoc(array(10, 20, 50, 100, 200, 500));
// Indexing throttle.
$form['indexing']['cron_limit'] = array(
// Indexing throttle:
$form['indexing_throttle'] = array(
'#type' => 'details',
'#title' => $this->t('Indexing throttle')
);
$form['indexing_throttle']['cron_limit'] = array(
'#type' => 'select',
'#title' => $this->t('Number of items to index per cron run'),
'#default_value' => $this->searchSettings->get('index.cron_limit'),
'#options' => $items,
'#description' => $this->t('The maximum number of items indexed during a <a href="@cron">cron maintenance task</a>. If necessary, reduce the number of items to prevent timeouts and memory errors while indexing.', array('@cron' => $this->url('system.cron_settings')))
'#description' => $this->t('The maximum number of items indexed in each pass of a <a href="@cron">cron maintenance task</a>. If necessary, reduce the number of items to prevent timeouts and memory errors while indexing.', array('@cron' => $this->url('system.status')))
);
// Indexing settings.
$form['indexing']['minimum_word_size'] = array(
// Indexing settings:
$form['indexing_settings'] = array(
'#type' => 'details',
'#title' => $this->t('Indexing settings')
);
$form['indexing_settings']['info'] = array(
'#markup' => $this->t('<p><em>Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.</em></p><p><em>The default settings should be appropriate for the majority of sites.</em></p>')
);
$form['indexing_settings']['minimum_word_size'] = array(
'#type' => 'number',
'#title' => $this->t('Minimum word length'),
'#title' => $this->t('Minimum word length to index'),
'#default_value' => $this->searchSettings->get('index.minimum_word_size'),
'#min' => 1,
'#max' => 1000,
'#description' => $this->t('Words shorter than this length will be ignored in search indexing and searching. A lower setting will result in a larger search database. Each search must contain a keyword that has at least this many characters.')
'#description' => $this->t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).')
);
$form['indexing']['overlap_cjk'] = array(
$form['indexing_settings']['overlap_cjk'] = array(
'#type' => 'checkbox',
'#title' => $this->t('Simple Chinese/Japanese/Korean handling'),
'#title' => $this->t('Simple CJK handling'),
'#default_value' => $this->searchSettings->get('index.overlap_cjk'),
'#description' => $this->t('Apply a tokenizer based on overlapping sequences; the alternative is using an external preprocessor. Does not affect other languages.')
'#description' => $this->t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.')
);
$form['indexing']['status'] = array(
'#markup' => $status,
);
$form['indexing']['wipe'] = array(
'#type' => 'submit',
'#value' => $this->t('Re-index site'),
'#submit' => array(array($this, 'searchAdminReindexSubmit')),
);
$form['plugins'] = array(
$form['active'] = array(
'#type' => 'details',
'#title' => $this->t('Search plugins')
'#title' => $this->t('Active search plugins')
);
$options = $this->getOptions();
$form['plugins']['active_plugins'] = array(
$form['active']['active_plugins'] = array(
'#type' => 'checkboxes',
'#title' => $this->t('Active plugins'),
'#title_display' => 'invisible',
'#default_value' => $this->searchSettings->get('active_plugins'),
'#options' => $options,
'#required' => TRUE,
'#description' => $this->t('Choose which search plugins are active from the available plugins.')
);
$form['plugins']['default_plugin'] = array(
'#title' => $this->t('Default plugin'),
'#required' => TRUE,
$form['active']['default_plugin'] = array(
'#title' => $this->t('Default search plugin'),
'#type' => 'radios',
'#default_value' => $this->searchSettings->get('default_plugin'),
'#options' => $options,
'#description' => $this->t('Choose which search plugin is the default.')
);
// Per plugin settings.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment