示例#1
0
        public override async Task <bool> ExistsAsync(CancellationToken cancellationToken)
        {
            // Create the request.
            IIndexExistsRequest request = new IndexExistsDescriptor(Indices.Index <T>());

            // Get the response.
            IExistsResponse response = await ElasticClient.IndexExistsAsync(request, cancellationToken)
                                       .ConfigureAwait(false);

            // Throw if invalid.
            response.ThrowIfError();

            // Return the response.
            return(response.Exists);
        }