|
|
|
@ -5,7 +5,7 @@ namespace Drupal\roblib_alter_solr;
|
|
|
|
|
use Drupal\search_api\IndexInterface; |
|
|
|
|
use Drupal\search_api\Item\ItemInterface; |
|
|
|
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
|
|
|
|
use Drupal\search_api_solr\Event\SolrDocumentAlterEvent; |
|
|
|
|
use Drupal\search_api_solr\Event\SearchApiSolrEvents; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Provides a Solr document alter event subscriber. |
|
|
|
@ -15,9 +15,10 @@ class SolrDocumentAlterSubscriber implements EventSubscriberInterface {
|
|
|
|
|
/** |
|
|
|
|
* {@inheritdoc} |
|
|
|
|
*/ |
|
|
|
|
public static function getSubscribedEvents() { |
|
|
|
|
$events[SolrDocumentAlterEvent::class][] = ['alterSolrDocument', 800]; // Priority 800 (adjust as needed) |
|
|
|
|
return $events; |
|
|
|
|
public static function getSubscribedEvents(): array { |
|
|
|
|
return [ |
|
|
|
|
SearchApiSolrEvents::POST_CREATE_INDEX_DOCUMENT => 'alterSolrDocument', |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|