code: public function postPersist(LifecycleEventArgs $args): void {
  		if(!$this->enableIndexing) {
  			return;
  		}
  		$this->updateEntity($args->getObject(), $args->getObjectManager());
  	}
docs: Index the entity after it is persisted for the first time
  
  @param LifecycleEventArgs $args