protected function SearchApiFederatedSolrSiteName::addSiteName in Search API Federated Solr 7
Same name and namespace in other branches
- 7.3 src/SearchApiFederatedSolrSiteName.php \SearchApiFederatedSolrSiteName::addSiteName()
- 7.2 src/SearchApiFederatedSolrSiteName.php \SearchApiFederatedSolrSiteName::addSiteName()
1 call to SearchApiFederatedSolrSiteName::addSiteName()
- SearchApiFederatedSolrSiteName::alterItems in src/
SearchApiFederatedSolrSiteName.php - Alter items before indexing.
File
- src/
SearchApiFederatedSolrSiteName.php, line 46
Class
- SearchApiFederatedSolrSiteName
- Class SearchApiFederatedSolrSiteName Provides a Search API index data alteration that adds a "Site Name" property to each indexed item.
Code
protected function addSiteName(array &$items) {
$site_name = !empty($this->options['site_name']) ? $this->options['site_name'] : variable_get('site_name');
foreach ($items as &$item) {
$item->site_name = [
$site_name,
];
}
}