public function replace(Document $document, array $options = [])
    {
        $documentId = $this->getDocumentId($document);

        return $this->replaceById($document, $documentId, $document, $options);
    }