You are here

function apachesolr_search_install in Apache Solr Search 8

Same name and namespace in other branches
  1. 6.3 apachesolr_search.install \apachesolr_search_install()
  2. 7 apachesolr_search.install \apachesolr_search_install()

Implements hook_install().

File

./apachesolr_search.install, line 11
Install and related hooks for apachesolr_search.

Code

function apachesolr_search_install() {

  // Add a taxonomy search page to the database
  $settings = array(
    'apachesolr_search_search_type' => 'tid',
    'apachesolr_search_per_page' => 10,
    'apachesolr_search_browse' => 'results',
    'apachesolr_search_spellcheck' => FALSE,
    'apachesolr_search_search_box' => FALSE,
  );
  $settings = serialize($settings);
  $fields = array(
    'page_id' => 'taxonomy_search',
    'label' => 'Taxonomy Search',
    'description' => 'Search all items with given term',
    'search_path' => 'taxonomy/term/%',
    'env_id' => '',
    'page_title' => '%value',
    'settings' => $settings,
  );
  db_insert('apachesolr_search_page')
    ->fields($fields)
    ->execute();
}