amateescu / search_api_solr

11 stars 14 forks source link

Remove search api autocomplete settings as the system is pluggable now #7

Closed BramG closed 10 years ago

BramG commented 10 years ago
if (module_exists('search_api_autocomplete')) {
      $form['advanced']['autocomplete'] = array(
        '#type' => 'fieldset',
        '#title' => $this->t('Autocomplete'),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
      );
      $form['advanced']['autocomplete']['autocorrect_spell'] = array(
        '#type' => 'checkbox',
        '#title' => $this->t('Use spellcheck for autocomplete suggestions'),
        '#description' => $this->t('If activated, spellcheck suggestions ("Did you mean") will be included in the autocomplete suggestions. Since the used dictionary contains words from all indexes, this might lead to leaking of sensitive data, depending on your setup.'),
        '#default_value' => $this->configuration['autocorrect_spell'],
      );
      $form['advanced']['autocomplete']['autocorrect_suggest_words'] = array(
        '#type' => 'checkbox',
        '#title' => $this->t('Suggest additional words'),
        '#description' => $this->t('If activated and the user enters a complete word, Solr will suggest additional words the user wants to search, which are often found (not searched!) together. This has been known to lead to strange results in some configurations – if you see inappropriate additional-word suggestions, you might want to deactivate this option.'),
        '#default_value' => $this->configuration['autocorrect_suggest_words'],
      );
    }

I think we can remove this from this module and move it to search_api_autocomplete.

drunken-monkey commented 10 years ago

Might make sense, yes. I don't know what you mean with "the system is pluggable now", but having these in the autocomplete search settings instead would probably make things clearer AND more flexible. The only reason to not do this in D7, too, though, would be compatibility problems (with unmatching versions of backend module and Autocomplete). But maybe create an issue there, we can just push it to D8 once we start on that for Autocomplete.

However, until then, we probably should just keep this there.

amateescu commented 10 years ago

Yup, I agree with keeping them for now. Clean-ups like this should happen when the related contrib module(s) are ported to 8.x.