public async IAsyncEnumerable ListCollectionNamesAsync()

in Elastic.SemanticKernel.Connectors.Elasticsearch/ElasticsearchVectorStore.cs [95:117]


    public async IAsyncEnumerable<string> ListCollectionNamesAsync(
        [EnumeratorCancellation] CancellationToken cancellationToken = default)
    {
        IReadOnlyList<string> collections;

        try
        {
            collections = await _elasticsearchClient.ListIndicesAsync(cancellationToken).ConfigureAwait(false);
        }
        catch (TransportException ex)
        {
            throw new VectorStoreOperationException("Call to vector store failed.", ex)
            {
                VectorStoreType = DatabaseName,
                OperationName = "ListCollections"
            };
        }

        foreach (var collection in collections)
        {
            yield return collection;
        }
    }