function hook_search_api_solr_field_mapping_alter in Search API Solr 8.3
Same name and namespace in other branches
- 8 search_api_solr.api.php \hook_search_api_solr_field_mapping_alter()
- 8.2 search_api_solr.api.php \hook_search_api_solr_field_mapping_alter()
- 7 search_api_solr.api.php \hook_search_api_solr_field_mapping_alter()
- 4.x search_api_solr.api.php \hook_search_api_solr_field_mapping_alter()
Change the way the index's field names are mapped to Solr field names.
Parameters
\Drupal\search_api\IndexInterface $index: The index whose field mappings are altered.
array $fields: An associative array containing the index field names mapped to their Solr counterparts. The special fields 'search_api_id' and 'search_api_relevance' are also included.
string $language_id: The language ID that applies for this field mapping.
1 invocation of hook_search_api_solr_field_mapping_alter()
- SearchApiSolrBackend::formatSolrFieldNames in src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php - Returns a language-specific mapping from Drupal to Solr field names.
File
- ./
search_api_solr.api.php, line 143 - Hooks provided by the Search API Solr search module.
Code
function hook_search_api_solr_field_mapping_alter(\Drupal\search_api\IndexInterface $index, array &$fields, string $language_id) {
$fields['fieldname'] = 'ss_fieldname';
}