You are here

function apachesolr_views_handler_field_snippet::options_form in Apache Solr Views 6

File

handlers/apachesolr_views_handler_field_snippet.inc, line 18
provides a field handler for the snippet coming from the ApacheSolr search engine

Class

apachesolr_views_handler_field_snippet
@file provides a field handler for the snippet coming from the ApacheSolr search engine

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['num_snippets'] = array(
    '#title' => t('Number of snippets to return'),
    '#type' => 'select',
    '#options' => drupal_map_assoc(range(1, 5)),
    '#default_value' => $this->options['num_snippets'],
    '#description' => t('The maximum number of highlighted snippets to generate'),
  );
  $form['fragsize'] = array(
    '#title' => t('Fragment Size'),
    '#type' => 'textfield',
    '#default_value' => $this->options['fragsize'],
    '#description' => t('The size in characters, of fragments for highlighting'),
  );
  $form['merge'] = array(
    '#title' => t('Merge Contiguous Fragments'),
    '#type' => 'radios',
    '#default_value' => $this->options['merge'],
    '#options' => array(
      'true' => t('Merge fragments'),
      'false' => t('Do not merge fragments'),
    ),
    '#description' => t('Collapse contiguous fragments into one fragment'),
  );
  $form['tag'] = array(
    '#title' => t('Tag for matching words'),
    '#type' => 'textfield',
    '#default_value' => $this->options['tag'],
    '#description' => t('HTML tag to surround the matching words in the snippet'),
  );
}