public function flush() {
        // no schema validation
        if(is_null($this->schema)) {
            throw SystemException::forNoSchema();
        }

        // flush elastic schema
        try {
            $this->resource
                ->indices()
                ->delete(
                    ['index' => $this->schema
                        ->getName()
                    ]
                );

            return true;
        } catch(\Throwable $e) {
            return false;
        }
    }