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