diff --git a/Search/ArticleSearchSubscriber.php b/Search/ArticleSearchSubscriber.php index 4eba9d8bd..8950b4873 100644 --- a/Search/ArticleSearchSubscriber.php +++ b/Search/ArticleSearchSubscriber.php @@ -14,7 +14,7 @@ use Massive\Bundle\SearchBundle\Search\Event\PreIndexEvent; use Massive\Bundle\SearchBundle\Search\Field; use Massive\Bundle\SearchBundle\Search\SearchEvents; -use Sulu\Bundle\ArticleBundle\Document\Behavior\WebspaceBehavior; +use Sulu\Bundle\ArticleBundle\Document\ArticleDocument; use Sulu\Bundle\ArticleBundle\Document\Resolver\WebspaceResolver; use Sulu\Bundle\SearchBundle\Search\Factory; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -58,10 +58,12 @@ public function handlePreIndex(PreIndexEvent $event) $subject = $event->getSubject(); $document = $event->getDocument(); - if (!$subject instanceof WebspaceBehavior) { + if (!$subject instanceof ArticleDocument) { return; } + $document->setUrl($subject->getRoutePath()); + $document->addField( $this->factory->createField( 'mainWebspace',