You are here

function date_apachesolr_field_mappings in Apache Solr Search 7

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

Implements hook_apachesolr_field_mappings() on behalf of date module.

File

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

Code

function date_apachesolr_field_mappings() {
  $mappings = array();
  $default = array(
    'indexing_callback' => array(
      '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'] = array(
    'apachesolr_datestamp_default_indexing_callback',
  );
  return $mappings;
}