repatched for custom dynmaic field definition : https://drupal.org/node/1846860#comment-7805861
This commit is contained in:
@@ -100,6 +100,46 @@ function hook_search_api_solr_multi_query_alter(array &$call_args, SearchApiMult
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Define how Search API Solr should index different data types.
|
||||
*
|
||||
* It is important to make sure that any types you define are also declared to
|
||||
* Search API using hook_search_api_data_type_info().
|
||||
*
|
||||
* @return array
|
||||
* An array containing data type definitions, keyed by their type identifier
|
||||
* and containing the following keys:
|
||||
* - prefix: The prefix used by the dynamic field type.
|
||||
* - always multiValued: (optional) Whether the single/multiple prefix should
|
||||
* be skipped for this data type. Defaults to FALSE.
|
||||
*
|
||||
* @see hook_search_api_solr_dynamic_field_info_alter()
|
||||
* @see search_api_solr_get_dynamic_field_info()
|
||||
* @see hook_search_api_data_type_info().
|
||||
*/
|
||||
function hook_search_api_solr_dynamic_field_info() {
|
||||
return array(
|
||||
'example_type' => array(
|
||||
'prefix' => 'ex',
|
||||
// Could be omitted, as FALSE is the default.
|
||||
'always multiValued' => FALSE,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Alter the data type indexing info.
|
||||
*
|
||||
* @param array $infos
|
||||
* The item type info array, keyed by type identifier.
|
||||
*
|
||||
* @see hook_search_api_solr_dynamic_field_info()
|
||||
*/
|
||||
function hook_search_api_solr_dynamic_field_info_alter(array &$infos) {
|
||||
// Change the prefix used for example_type.
|
||||
$info['example_type']['prefix'] = 'ex2';
|
||||
}
|
||||
|
||||
/**
|
||||
* @} End of "addtogroup hooks".
|
||||
*/
|
||||
|
Reference in New Issue
Block a user