You are here

function search_api_solr_hook_search_api_data_type_info in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 search_api_solr.api.php \search_api_solr_hook_search_api_data_type_info()
  2. 8 search_api_solr.api.php \search_api_solr_hook_search_api_data_type_info()
  3. 8.2 search_api_solr.api.php \search_api_solr_hook_search_api_data_type_info()
  4. 7 search_api_solr.api.php \search_api_solr_hook_search_api_data_type_info()

Provide Solr dynamic fields as Search API data types.

This serves as a placeholder for documenting additional keys for hook_search_api_data_type_info() which are recognized by this module to automatically support dynamic field types from the schema.

Return value

array In addition to the keys for the individual types that are defined by hook_search_api_data_type_info(), the following keys are regonized:

  • prefix: The Solr field name prefix to use for this type. Should match two existing dynamic fields definitions with names "{PREFIX}s_*" and "{PREFIX}m_*".

See also

hook_search_api_data_type_info()

File

./search_api_solr.api.php, line 198
Hooks provided by the Search API Solr search module.

Code

function search_api_solr_hook_search_api_data_type_info() {
  return [
    // You can use any identifier you want here, but it makes sense to use the
    // field type name from schema.xml.
    'edge_n2_kw_text' => [
      // Stock hook_search_api_data_type_info() info:
      'name' => t('Fulltext (w/ partial matching)'),
      'fallback' => 'text',
      // Dynamic field with name="te_*".
      'prefix' => 'te',
    ],
    'tlong' => [
      // Stock hook_search_api_data_type_info() info:
      'name' => t('TrieLong'),
      'fallback' => 'integer',
      // Dynamic fields with name="its_*" and name="itm_*".
      'prefix' => 'it',
    ],
  ];
}