You are here

function date_apachesolr_field_mappings in Apache Solr Search 8

Same name and namespace in other branches
  1. 6.3 apachesolr.module \date_apachesolr_field_mappings()
  2. 7 apachesolr.module \date_apachesolr_field_mappings()

Implements hook_apachesolr_field_mappings() on behalf of date module.

File

./apachesolr.module, line 2525
Integration with the Apache Solr search application.

Code

function date_apachesolr_field_mappings() {
  $mappings = array();
  $default = array(
    'indexing_callback' => 'apachesolr_date_default_indexing_callback',
    'index_type' => 'date',
    'facets' => TRUE,
    'query types' => array(
      'date',
    ),
    'query type' => 'date',
    'min callback' => 'apachesolr_get_min_date',
    'max callback' => 'apachesolr_get_max_date',
    'map callback' => 'facetapi_map_date',
  );

  // DATE and DATETIME fields can use the same indexing callback.
  $mappings['date'] = $default;
  $mappings['datetime'] = $default;

  // DATESTAMP fields need a different callback.
  $mappings['datestamp'] = $default;
  $mappings['datestamp']['indexing_callback'] = 'apachesolr_datestamp_default_indexing_callback';
  return $mappings;
}