def test_indexing_exception_error(
        self,
        sync_client: Elasticsearch,
        index: str,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        """Test bulk exception logging is giving better hints."""
        store = VectorStore(
            index=index,
            retrieval_strategy=BM25Strategy(),
            client=sync_client,
        )

        store.client.indices.create(
            index=index,
            mappings={"properties": {}},
            settings={"index": {"default_pipeline": "not-existing-pipeline"}},
        )

        texts = ["foo"]

        with pytest.raises(BulkIndexError):
            store.add_texts(texts)

        error_reason = "pipeline with id [not-existing-pipeline] does not exist"
        log_message = f"First error reason: {error_reason}"

        assert log_message in caplog.text
Test bulk exception logging is giving better hints.
test_elasticsearch/test_server/test_vectorstore/test_vectorstore.py