You are here

function apachesolr_index_key in Apache Solr Search 6

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_index_key()
  2. 5.2 apachesolr.module \apachesolr_index_key()
  3. 5 apachesolr.module \apachesolr_index_key()
  4. 6.3 apachesolr.module \apachesolr_index_key()
  5. 6.2 apachesolr.module \apachesolr_index_key()
  6. 7 apachesolr.module \apachesolr_index_key()

array('index_type' => 'integer', 'multiple' => TRUE, 'name' => 'fieldname', ),

5 calls to apachesolr_index_key()
apachesolr_node_to_document in ./apachesolr.index.inc
Given a node ID, return a document representing that node.
apachesolr_search_apachesolr_facets in ./apachesolr_search.module
Implementation of hook_apachesolr_facets().
apachesolr_search_block in ./apachesolr_search.module
Implementation of hook_block().
apachesolr_search_update_6001 in ./apachesolr_search.install
Update to block deltas.
_apachesolr_og_gid_key in contrib/apachesolr_og/apachesolr_og.module
Apachesolr index name for Organic group id

File

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

Code

function apachesolr_index_key($field) {
  switch ($field['index_type']) {
    case 'text':
      $type_prefix = 't';
      break;
    case 'string':
      $type_prefix = 's';
      break;
    case 'integer':
      $type_prefix = 'i';
      break;
    case 'sint':
      $type_prefix = 'si';
      break;
    case 'double':
      $type_prefix = 'p';

      // reserve d for date
      break;
    case 'boolean':
      $type_prefix = 'b';
      break;
    case 'date':
      $type_prefix = 'd';
      break;
    case 'float':
      $type_prefix = 'f';
      break;
    case 'tdate':
      $type_prefix = 'td';
      break;
    case 'tint':
      $type_prefix = 'ti';
      break;
    case 'tlong':
      $type_prefix = 'tl';
      break;
    case 'tfloat':
      $type_prefix = 'tf';
      break;
    case 'tdouble':
      $type_prefix = 'tp';
      break;
    default:
      $type_prefix = 's';
  }
  $sm = $field['multiple'] ? 'm_' : 's_';
  return $type_prefix . $sm . $field['name'];
}