public function onAfterWrite() {
        if (\Config::inst()->get('ElasticSearch', 'disabled') || !$this->owner->autoIndex()) {
            return;
        }
        $stage = \Versioned::current_stage();
        
		$this->service->index($this->owner, $stage);
	}
public function onAfterWrite() {
        if (\Config::inst()->get('ElasticSearch', 'disabled') || !$this->owner->autoIndex()) {
            return;
        }
        $stage = \Versioned::current_stage();
        
		$this->service->index($this->owner, $stage);
	}
public function onAfterWrite ( ) { if ( \ Config :: inst ( ) -> get ( 'ElasticSearch' , 'disabled' ) || ! $ this -> owner -> autoIndex ( ) ) { return ; } $ stage = \ Versioned :: current_stage ( ) ; $ this -> service -> index ( $ this -> owner , $ stage ) ; }
Updates the record in the search index.
Updates the record in the search index .