public function onIndex(IndexEvent $event)
    {
        try {
            $this->searchManager->index($event->getSubject());
        } catch (MetadataNotFoundException $ex) {
            // no metadata found => do nothing
        }
    }
public function onIndex(IndexEvent $event)
    {
        try {
            $this->searchManager->index($event->getSubject());
        } catch (MetadataNotFoundException $ex) {
            // no metadata found => do nothing
        }
    }
public function onIndex ( IndexEvent $ event ) { try { $ this -> searchManager -> index ( $ event -> getSubject ( ) ) ; } catch ( MetadataNotFoundException $ ex ) { // no metadata found => do nothing } }
Index subject from event.

@param IndexEvent $event
Index subject from event .