public function SearchApiFederatedSolrUrls::alterItems in Search API Federated Solr 7.3
Same name and namespace in other branches
- 7 src/SearchApiFederatedSolrUrls.php \SearchApiFederatedSolrUrls::alterItems()
- 7.2 src/SearchApiFederatedSolrUrls.php \SearchApiFederatedSolrUrls::alterItems()
Alter items before indexing.
Items which are removed from the array won't be indexed, but will be marked as clean for future indexing. This could for instance be used to implement some sort of access filter for security purposes (e.g., don't index unpublished nodes or comments).
Parameters
array $items: An array of items to be altered, keyed by item IDs.
Overrides SearchApiAlterCallbackInterface::alterItems
File
- src/
SearchApiFederatedSolrUrls.php, line 37
Class
- SearchApiFederatedSolrUrls
- Class SearchApiFederatedSolrUrls Provides a Search API index data alteration that adds the sites that the content is available on to each indexed item.
Code
public function alterItems(array &$items) {
if ($this
->useDomainAccess()) {
$this
->addDomainUrls($items);
}
else {
$this
->addUrl($items);
}
}