def test_delete(self, sync_client: Elasticsearch, index: str) -> None:
        """Test delete methods from vector store."""
        store = VectorStore(
            index=index,
            retrieval_strategy=DenseVectorStrategy(),
            embedding_service=FakeEmbeddings(),
            client=sync_client,
        )

        texts = ["foo", "bar", "baz", "gni"]
        metadatas = [{"page": i} for i in range(len(texts))]
        ids = store.add_texts(texts=texts, metadatas=metadatas)

        output = store.search(query="foo", k=10)
        assert len(output) == 4

        store.delete(ids=ids[1:3])
        output = store.search(query="foo", k=10)
        assert len(output) == 2

        store.delete(ids=["not-existing"])
        output = store.search(query="foo", k=10)
        assert len(output) == 2

        store.delete(ids=[ids[0]])
        output = store.search(query="foo", k=10)
        assert len(output) == 1

        store.delete(ids=[ids[3]])
        output = store.search(query="gni", k=10)
        assert len(output) == 0
Test delete methods from vector store.
test_elasticsearch/test_server/test_vectorstore/test_vectorstore.py