public function afterSave(Event $event, EntityInterface $entity, ArrayObject $options)
    {
        $isNew = $entity->isNew();
        if (($this->config('on') === 'update' && $isNew) ||
            ($this->config('on') === 'insert' && !$isNew) ||
            (isset($options['index']) && $options['index'] === false)
        ) {
            return;
        }

        $this->_table->dispatchEvent('Model.beforeIndex', compact('entity'));
        $success = $this->searchEngine()->index($entity);
        $this->_table->dispatchEvent('Model.afterIndex', compact('entity', 'success'));
    }