def test_delete_doc(self) -> None:
        """Test delete document from Vertex AI Vector Search index."""
        embed_model = VertexTextEmbedding(project=PROJECT_ID, location=REGION)
        Settings.embed_model = embed_model
        vector_store = self.vector_store()
        storage_context = StorageContext.from_defaults(vector_store=vector_store)

        # Add nodes to the Vertex AI Vector Search index
        page_content = (
            "A vibrant swimsuit with a bold geometric pattern. This fun "
            "and eye-catching piece is perfect for making a splash by the pool or at "
            "the beach."
        )
        VectorStoreIndex.from_documents(
            [
                Document(
                    doc_id=create_uuid(page_content),
                    text=page_content,
                    metadata={
                        "color": "multicolor",
                        "price": 55.00,
                        "season": ["summer"],
                    },
                ),
            ],
            storage_context=storage_context,
        )

        # similarity search
        query = "swimsuit with a bold geometric pattern"
        query_embedding = embed_model.get_query_embedding(query)
        q = VectorStoreQuery(query_embedding=query_embedding, similarity_top_k=1)

        result = vector_store.query(q)
        assert result.nodes is not None and len(result.nodes) == 1

        # Identify the document to delete
        ref_id_to_delete = result.nodes[0].ref_doc_id

        # Delete the document
        vector_store.delete(ref_doc_id=ref_id_to_delete)

        # Ensure that no results are returned
        result = utils.get_datapoints_by_filter(
            index=vector_store.index,
            endpoint=vector_store.endpoint,
            metadata={"ref_doc_id": ref_id_to_delete},
        )
        assert len(result) == 0
Test delete document from Vertex AI Vector Search index.
llama-index-integrations/vector_stores/llama-index-vector-stores-vertexaivectorsearch/tests/test_vector_stores_vertexaivectorsearch.py